cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Email Recepients when using mail pacakging in JAVA AMpping

Former Member
0 Kudos

Hello Experts,

i am new to the PI and i am trying to implement a file to mail scenario. i am following Stefan Grube's blog (/people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-emails-with-attachment-with-help-of-java-mapping) to send email using JAVA Mapping. i am able to send email to one recepient and i want to send to multiple recepients. i have tried with semicolon between two email Ids and it is not working. Any thoughts or help in this regard will be highly appreciated.

public void execute(InputStream in, OutputStream out)

throws StreamTransformationException {

String mailSubject = "=?utf-8?Q?Auftragsbest=C3=A4tigung?=";

String mailSender = "\"My Address\"<my address>";

String mailReceiver = "\"Your Address\"<address1;address2>";

Thanks & Regards

- Siva.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member200962
Active Contributor
0 Kudos

String mailReceiver = "\"Your Address\"<address1;address2>";

I hope that in your actual java mapping you are using the below mentioned format in the blog:

String mailReceiver = "\"Your Address\"&lt;your.address+at+company.com&gt;";

check usage of lt / gt for < / >

An email id needs to be separated using a semicolon only:)

Regards,

Abhishek.

format getting changed:(

Edited by: abhishek salvi on May 5, 2009 1:24 PM

Shabarish_Nair
Active Contributor
0 Kudos

try directly with,

String mailReceiver = "emailID1,emailD2";

use comma as separator

and then try with semicolons if commas dont work

Former Member
0 Kudos

Hello Shabarish,

Thanks for the reponse. i have tried as you mentioed but no luck.

When i tried option 1 (With comma) - there was no error but didn't receive any email.

When i tried option 2 (with semicolon) - gave below error.

failed to send mail: java.io.IOException: server not responding OK to RCPT TO; 501 5.5.4 Invalid Address

Thanks

- Siva

Former Member
0 Kudos

Hi,

Thanks for your time. i have got the solution. we have to use <To><address 1>;<address 2></To>.

Thanks.