[resolved] tSendMail : multiple address

One Star

[resolved] tSendMail : multiple address

Hi,
I try to user tSendMail component (in java, TOS release 2.3.3) from sending mail at two adress.
Adress are in a context variable.
When i use ';' from separate address in context variable for "To" fiel, i have this error :
"tarting job testmail at 17:35 07/07/2008.
Exception in component tSendMail_1
javax.mail.internet.AddressException: Illegal semicolon, not in group in string ``psoulet@domain1.com;psoulet@domain2.fr'' at position 19
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:780)
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:555)
at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:91)
at testmail.testmail.testmail.tSendMail_1Process(testmail.java:172)
at testmail.testmail.testmail.runJobInTOS(testmail.java:360)
at testmail.testmail.testmail.main(testmail.java:261)
Job testmail ended at 17:35 07/07/2008. "
When i use ',', ive this error :
"Starting job testmail at 17:40 07/07/2008.
Exception in component tSendMail_1
javax.mail.internet.AddressException: Illegal address in string ``psoulet@domain1.com;psoulet@domain2.fr''
at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:94)
at testmail.testmail.testmail.tSendMail_1Process(testmail.java:172)
at testmail.testmail.testmail.runJobInTOS(testmail.java:360)
at testmail.testmail.testmail.main(testmail.java:261)
Job testmail ended at 17:40 07/07/2008. "

Any idea ?
Thx

Accepted Solutions
Community Manager

Re: [resolved] tSendMail : multiple address

Hello
See 3822.
There should be a blank space around semicolon, for example:
"psoulet@domain1.com ; psoulet@domain2.fr''
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Community Manager

Re: [resolved] tSendMail : multiple address

Hello
See 3822.
There should be a blank space around semicolon, for example:
"psoulet@domain1.com ; psoulet@domain2.fr''
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] tSendMail : multiple address

I've test ...
Without context variable, it's ok, but when i use a context variable, i've always the error :
"tarting job envoiMail at 10:36 08/07/2008.
Exception in component tSendMail_1
javax.mail.internet.AddressException: Illegal semicolon, not in group in string ``psoulet@domain1.com ; patrice.soulet@domainn2.fr'' at position 20
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:780)
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:555)
at sugarutilities.envoimail_0_1.envoiMail.tSendMail_1Process(envoiMail.java:184)
at sugarutilities.envoimail_0_1.envoiMail.runJobInTOS(envoiMail.java:377)
at sugarutilities.envoimail_0_1.envoiMail.main(envoiMail.java:275)
Job envoiMail ended at 10:36 08/07/2008.
"
Community Manager

Re: [resolved] tSendMail : multiple address

Hello
I have checked that it should be a 4479.
Thanks for your support!
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] tSendMail : multiple address

Thanks, i'll look at bugtracker now.
Regards.
Patrice
One Star

Re: [resolved] tSendMail : multiple address

It's working for me , here is the steps i followed :
- I created a boolean context variable named Error.
- Then i put a test on tJava component to test then number of rows and put Error on true if the rows == 0.
- Then (see the picture) i put a condition , on a second string context variable Recipients.
- Finaly i put the Recipients variable in the tSendMail
Four Stars

Re: [resolved] tSendMail : multiple address

Hi Largouwalid,
could you please elaborate this (Then i put a test on tJava component to test then number of rows and put Error on true if the rows == 0.
  - Then (see the picture) i put a condition , on a second string context variable Recipients.)

how to create a boolean context varible named error, condition?
Community Manager

Re: [resolved] tSendMail : multiple address

Hi Largouwalid,
could you please elaborate this (Then i put a test on tJava component to test then number of rows and put Error on true if the rows == 0.
  - Then (see the picture) i put a condition , on a second string context variable Recipients.)

how to create a boolean context varible named error, condition?

What is rows in your case? A screenshot of your job will be helpful for us to understand the problem.
----------------------------------------------------------
Talend | Data Agility for Modern Business
Four Stars

Re: [resolved] tSendMail : multiple address

Hi,

How to   database driven to get the email address for tsend component?
Table : email_setting
Project | EmailAddress
==================
ENA    yyyy@xxx.com
Edw xxx@xxx.com
If the job belongs to project then select the project specific email and send email using tsendemail.
If the  job success success send to yyy@xxx.com if job failed send to xxx@xxx.com.
How to implement  this whole process in a joblet?
then how to send multile emails
in my project i have nearly 100 jobs i need to implement this to all job with joblet
Here i have attached some screen shots of my job.
this is  job
========

in this job id  have link(onsubjobok) to tFixedFlowinput .this works when job has success .
i need to create a job success and failed  with single componet
  
in tFxiedflowinput i can retrive Project name using Global variable.
I have lookp with email setting in  tamp  retried  project specific email id
context editor
===========

In tJava component i have write below code
================================

if(context.Job_status != true)
 context.Recipients (String)globalMap.get("fd.email_address"));=====> this is retrived  from tFlowTOItereate component
  else
 context.Recipients="xxxxx@gmail.com";

how to create a joblet for this, when job has success and failed .

Thanks
Sasi

What’s New for Talend Spring ’19

Join us live for a sneak peek!

Sign up now

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads