cancel
Showing results for 
Search instead for 
Did you mean: 

Sending email with different address

theoryoflinkin
Champ on-the-rise
Champ on-the-rise
Hi everyone,

For the moment, in my workflow, I have an email task that sends emails to a specific address.

But my problem is that this uses always the same address to send the mail.

What I need is to send the email with the address of the workflow initiator.

I can get this address but it always sends the email with the default address.

For example:

var mail = actions.create("mail");
mail.parameters.subject = "";
mail.parameters.from = execution.getVariable('util_mailInitiator');
mail.parameters.to = execution.getVariable('util_mailRequester');
mail.parameters.text = "…";
mail.execute(bpm_package);

This will send email with the default email in my SMTP configuration (mail.username) as "from" parameters. And it will not use the "execution.getVariable('util_mailInitiator')"

My SMTP configuration:

mail.from.enabled=true
mail.from.default=cgt@alfresco.org
mail.host=smtp.live.com
mail.port=587
mail.username=****@wavenet.be
mail.password=****
mail.protocol=smtp
mail.smtp.starttls.enable=true
mail.smtp.auth=true
mail.encoding=UTF-8


Is there a way to change this?

Hope this clear

Thanks in advance
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
It should work.   Sorry I can't see an error in what you have posted.    

theoryoflinkin
Champ on-the-rise
Champ on-the-rise
Hi,

Thank you for this answer.

In fact, you're right.

I have a custom class for sending mail with attachment. And when I try to send mail with default alfresco bean, it works.

So the problem is in my custom class…

Thank you for the help