Html Email by Dssendmail Routine
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 43
- Joined: Wed Feb 12, 2014 12:34 pm
- Location: Hyderabad, India
Html Email by Dssendmail Routine
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?
SyedMuhammadMehdi
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.
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.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 43
- Joined: Wed Feb 12, 2014 12:34 pm
- Location: Hyderabad, India
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;
echo "<html><b>Hello</b></html>"| mail -s "$(echo -e "This is Subject\nContent-Type: text/html")" muhammed@abc.com;
SyedMuhammadMehdi
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.
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.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 43
- Joined: Wed Feb 12, 2014 12:34 pm
- Location: Hyderabad, India
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?
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?
SyedMuhammadMehdi
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;
echo "<html><b>Hello</b></html>"| /usr/bin/mail -s "$(echo "This is Subject\nContent-Type: text/html")" muhammed@abc.com;
Thanks and Regards,
Mounika P
Mounika P
-
- Participant
- Posts: 43
- Joined: Wed Feb 12, 2014 12:34 pm
- Location: Hyderabad, India
Re: Html Email by Dssendmail Routine
I build header and body email file in datastage and then used command
cat email.txt | /usr/bin/sendmail -t -oi
and it worked.
cat email.txt | /usr/bin/sendmail -t -oi
and it worked.
SyedMuhammadMehdi