cancel
Showing results for 
Search instead for 
Did you mean: 

MailActionExecuter.PARAM_TO_MANY parameter not working

nowhere
Champ in-the-making
Champ in-the-making
Hi all,
I was using with previuos Alfresco Version this code:

                      Action mailAction1 = this.actionService.createAction(MailActionExecuter.NAME);
            mailAction1.setParameterValue(
            MailActionExecuter.PARAM_SUBJECT , "Some questions");
            mailAction1.setParameterValue(MailActionExecuter.PARAM_TO_MANY , recipients);
            mailAction1.setParameterValue(MailActionExecuter.PARAM_FROM,   "alfresco@alfresco.org");
            mailAction1.setParameterValue(MailActionExecuter.PARAM_TEXT, "Your txt here ");
            this.actionService.executeAction(mailAction1, null);

but now, using PARAMETER_TO_MANY causes exception:

UserSmiley Tonguerova4 ERROR [action.executer.MailActionExecuter] Failed to se
nd email to mail@alfresco.org
org.springframework.mail.MailPreparationException: Could not prepare mail; neste
d exception is java.lang.NullPointerException
Caused by: java.lang.NullPointerException
        at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:557)

I saw the problem, in SMTPTransport class is on "addresse" that are null.

Can anyone tell me how to send email to multiple recipients with a ";" separated list?

Thanks in advance!
1 REPLY 1

feedler
Champ in-the-making
Champ in-the-making
Hi Nowhere,

I have the same problem with the MailActionExecuter, though I'm trying to send the mail via a scheduled action.

The problem is that this action doesn't take mail-addresses as an input for the to_many parameter but rather a list of usernames. These get checked against the authority service and in case the user exists, his mail-address is used (if existent). If you provide mail-addresses instead of usernames the current implementation does not find the users and thus does not add the addresses to the list of recipiants. It seems that this action could use a revision.

As it further doesn't seem to be possible to define a list of values for the to_many parameter in case you want to define the action via a SimpleTemplateActionDefinition, I would like to see a to parameter that also accepts a comma or semicolon seperated list of mail-addresses. Maybe I have to define such an action myself.

Cheers
Chris