最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin8PV0评论

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
Post a comment

comment list (0)

  1. No comments so far