tSendMail error on message newline

Six Stars

tSendMail error on message newline

Hello,
I use a tSendMail component and i have a problem with message content.
In my message, when there is a new ligne there is a java error in source code.
So, I replace new ligne by \n and it's OK.
How i can replace new line by \n automatically ? ( or it's an option in settings )
Message content OK
"Hello,"
+"\n\nWorld"
Message content NOK
"Hello,"
World"
Thanks !
Arnaud
Four Stars

Re: tSendMail error on message newline

Hi Arnaud,
Talend can't change new line char automatically in tSendMail component, we have to specify it manually...
if required, during data flow you can replace some char by using EReplace or tReplace or regular expression by \n but for this also you need to define some rule... this can't happen automatically.
vaibhav
Moderator

Re: tSendMail error on message newline

Hi,
You can set your message as Context Vaule then sending them to tSendMail.
Please see my Screenshots
Let me know if it is OK with you.
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.
Six Stars

Re: tSendMail error on message newline

Hi,
You can see my screeshots.
This email is sending at the end of the job. The message content is just text and not a result of an another component.
There is code on error component :
String message_tSendMail_2 = (("Bonjour
Le replay est terminé.") == null || "".equals("Bonjour
Le replay est terminé.")) ? "\"\"" : ("Bonjour
Le replay est terminé.") ;
You can see newline is not replace by \n automaticaly.
I use TOS 5.5.1, may be it's a bug ?
However, I use the button "..." at the right textarea message content because I thought, when the popup message content is validate, Talend replace newline by \n
Thanks for your help,
Arnaud
One Star

Re: tSendMail error on message newline

I use Talend Open Studio for Data Integration Version 6.0.1 and have the same problem.
In the component tSendMail (Message) is it not possible to use a new line with \n or "|" or whatever.
In Talend Version 5.X thats was no problem.

Moderator

Re: tSendMail error on message newline

Hi blub,
Would you mind showing us your the screenshot of message part in tSendMail component?
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: tSendMail error on message newline

I know this is an old thread but i am trying to do this and I am having trouble with the following...
You can set your message as Context Vaule then sending them to tSendMail.
Please see my Screenshots

 How do I set the results of tFixedFlowInput to a context variable?  I am not seeing the results of tFixedFlowInput when I hit ctl+space
One Star

Re: tSendMail error on message newline

I accomplished this using tJava instead of tFixedFlow