Reputation:
The Alfresco documentation talks about a paramater to_many
to send an email to multiple recipients. Using this parameter from JavaScript does not work for me.
mail.parameters.to = "User 0 <[email protected]>";
mail.parameters.to_many = "User 1 <[email protected]>, User 2 <[email protected]>";
Using both to
and to_many
like this ignores to_many
and only send to to
.
Using only to_many
like
mail.parameters.to_many = "User 1 <[email protected]>, User 2 <[email protected]>";
throws a NPE at
com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:557)
What is the correct way to use to_many
in JavaScript to send an email to multiple recipients?
Upvotes: 0
Views: 2276
Reputation: 6450
Alfresco v.5.2 EA9 supports mixed array of email address, users and groups:
mail.parameters.to_many = [
'[email protected]',
'"User 1" <[email protected]>',
'username1',
'GROUP_ALFRESCO_ADMINISTRATORS'];
You can use https://papercut.codeplex.com/ to test it, Alfresco configuration:
# smtp settings
mail.host=localhost
mail.port=25
mail.protocol=smtp
mail.smtp.auth=false
# mail.smtp.timeout=30000
# mail.smtp.debug=true
Upvotes: 2
Reputation: 6159
The parameter to_many
is expected to be an array of authority names.
mail.parameters.to_many = ['username1', 'GROUP_ALFRESCO_ADMINISTRATORS'];
Will send the email to the user with username1 and all members of the ALFRESCO_ADMINISTRATORS group.
Upvotes: 6