Wednesday, August 15, 2012
HTML mail from SybaseIQ- Sendmail linelength problem (weird ! character)
One of the best ways to send HTML mail from SybaseIQ on IBM AIX is to use sendmail.
Unfortunately sendmail has linelength limit (2040 characters default). After 2040th character sendmail is adding ! and new line characters to text which is ruining HTML.
To fix this problem:
- Change Linelimit info in Sendmail.cf file. Add L=4096 (or any other suitable value) to corresponding mailer.
- To identify correct mailer check mail log at /var/log/maillog file. Mailer name is mostly Mrelay
- After these steps ! character shall be removed from your mail.
- You may add || CHAR(13) || CHAR(10) after each </tr> statement to add new line in SQL as well.
execute immediate 'exec xp_cmdshell ''(echo "From: myadreess@mail.com."; echo "To: dest1@mail.com,dest2@mail.com"; echo "MIME-Version: 1.0";echo "Content-Type: text/html"; echo "<html><body bgcolor=black><blockquote><font color=green>GREEN</font> <font color=white>WHITE</font> <font color=red>RED</font><font color=blue>Powered by Sybase IQ</font></blockquote></body></html>") | sendmail -t''';
Bu bilgi çok işime yaradı ,çok teşekkürler Ongun
ReplyDelete