Page 1 of 1

Html Email by Dssendmail Routine

Posted: Fri Nov 03, 2017 11:00 am
by syedmuhammedmehdi
Hi, I want to send automatic email from datastage sequence through dssendmail routine but i want to send html mail having a html table in body of email. Could you please advise can we sent html email thru dssendmail?

Posted: Fri Nov 03, 2017 11:08 am
by chulett
You can't.

Probably best to write a script to do that and then use the Execute Command stage instead. Either that or you'd need to copy the DSSendMail routine to a new name and modify it to do what you need. Depending on where your skill set lies.

Posted: Sun Nov 05, 2017 12:20 am
by syedmuhammedmehdi
thanks, Ok, I'm using below command from execute command stage but it is not converting tags into proper html format and just getting it as plain text, could you please advise what may be the issue with the below command?


echo "<html><b>Hello</b></html>"| mail -s "$(echo -e "This is Subject\nContent-Type: text/html")" muhammed@abc.com;

Posted: Sun Nov 05, 2017 9:28 am
by chulett
Involve your UNIX admins / experts at your site.

What O/S is this? I'm not familiar with "mail" but have used "sendmail" and "mailx" but again not to try to send HTML email. Are you certain it is allowed by your recipient's email system? I haven't bothered because everything is converted to plain text by our email servers, hence the question.

Posted: Sun Nov 05, 2017 6:44 pm
by syedmuhammedmehdi
It is UNIX. Yes, it is allowed by recipient 's email system. In plain text actually the issue is one code which is in proper alignment for one text type ex:- Calibri will necessarily will not be in proper alignment for all other types i.e. Arial, Times etc so I want to create it using html table with <td> <tr> tags.
Also, yes I tried by using mailx but it did not work. Can we use sendmail command in one line so that it can be executed by execute command stage?

Posted: Mon Nov 06, 2017 7:19 am
by chulett
That question seems like something Google could easily answer for you. And if you can't do it all in one line, write a script to handle it.

Posted: Mon Nov 06, 2017 10:33 pm
by MounikaP
I think the below should work.

echo "<html><b>Hello</b></html>"| /usr/bin/mail -s "$(echo "This is Subject\nContent-Type: text/html")" muhammed@abc.com;

Re: Html Email by Dssendmail Routine

Posted: Wed Nov 08, 2017 9:59 am
by syedmuhammedmehdi
I build header and body email file in datastage and then used command

cat email.txt | /usr/bin/sendmail -t -oi

and it worked.