Send mail to multiple user

One Star

Send mail to multiple user

Hi everybody,
I have a job that already send mail to one user, but once i add other users seperated by semicolons it doesn't work.
the email adresses are defined as context and are explicitly defined in properties file (xxxx@xxxx.xx).

Thanks for your reply .

One Star

Re: Send mail to multiple user

here are the screenshots
Six Stars

Re: Send mail to multiple user

Hi Soukainaez,
you need to give email ids separated by , (comma) Example :: context.emailid1+","+context.emailid2. we need to provide , in double quotes because , is constant and context variable will be replaced at runtime
Raghunath Lingutla
One Star

Re: Send mail to multiple user

Thank you so much for your reply but i still have problem.
even if email addresses are defined in properties file. 
here is the screenshot .

Moderator

Re: Send mail to multiple user

Hi,
Please try to use " ; “, such as, context.mailid1+";"+context.emailid2 to see if it works?
How many users do you want to send? Have you tried tContextLoad or implicit tContextLoad (context variable for the 'To' field)to load the address value from a file or a database?

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Send mail to multiple user

i tried ; instead of , but it doesn't work , i want to send email to 3 users.
thank you for your help.
Moderator

Re: Send mail to multiple user

Hi,

Can you send your email successfully to many addresses direactly through xxx@xxx.com ; xxx@xxx.com ;?

Here is another solution for your job requirement, please take a look at my screenshots.
Please see a scenario in component reference:TalendHelpCenter:tContextLoad
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Send mail to multiple user

Hi,
I tried to send email directly it works. But once i use contexte it gives me the same error :"CTX_MAIL_SMPT_RECEIVER ne peut etre résolu ou n'est pas un champ" !
Could tell me where this error come from?
Thank you so much
Moderator

Re: Send mail to multiple user

Hi soukainaez,
It seems somthing wrong with your variable.
Could you please show us the screenshots of your Contexts value setting? Is it Ok when you use only one context value in "To" fiels, such as, CTX_MAIL_SMPT_RECEIVER_User1?
Have you tried to switch the view from "Designer" to "Code"  to see the error line in java?

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog