javascript - Sending an email to multiple recipients in Alfresco - Stack Overflow

admin2025-04-26  1

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

.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?

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

.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?

Share Improve this question asked Jul 4, 2014 at 14:23 user1907906user1907906
Add a ment  | 

2 Answers 2

Reset to default 6

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.

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./ 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
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745604271a309488.html

最新回复(0)