Page 1 of 1

How to add html code or any idea in TI process while sending email

Posted: Mon Jul 04, 2016 6:32 pm
by dilip
Hi,
Iam facing 1 issue..i.e

I want to send email using TI process...but new line is not coming..in Body part of email..I tried Char(10),Char(13),\n,\r\n,%20...but no progress....Can anyone of you help me in getting a body to be separate...or any idea which best suits...all the article which i got...looks complex...

I want the format as shown below
Hi,

ABCCccccccccccccc
Deffffffffff

Thanks

But Iam getting the format as Hi,ABCccccccccccDefffffffffff

Thanks

Re: How to add html code or any idea in TI process while sending email

Posted: Mon Jul 04, 2016 6:34 pm
by declanr
What are you using to send emails?
VBS, an executable, powershell etc.

Re: How to add html code or any idea in TI process while sending email

Posted: Mon Jul 04, 2016 6:42 pm
by dilip
Currently I am using TI code no vbs....no other scripting i have used except TM1 code of sending email which i got from google.

similar to like as shown below...need to format body of an email like as shown below....means i need "enter" after 2 line.....

sFrom = 'tm1@yourcompany';
sTo = 'robin.mackenzie@somewhere.com';
sSubject = 'test';
sBody = 'test';
sSmtpServer = 'name of your smtp server';

# build powershell command
sPsCmd = '"& {
Send-MailMessage
-From ' | sFrom | '
-To ' | sTo | '
-Subject ' | '\"' | sSubject | '\"
-Body ' | '\"' | sBody | '\"
-SmtpServer ' | sSmtpServer | '
}"';

# execute command
ExecuteCommand ( 'powershell.exe -command ' | sPsCmd, 1 );

Re: How to add html code or any idea in TI process while sending email

Posted: Mon Jul 04, 2016 6:56 pm
by declanr
Your code is using powershell.
Add the -BodyAsHTML parameter and then you can format the body using full HTML functionality.