12-23-2012 06:14 AM
I am trying something new on this Christmas with the SAS..
I am writing a mail to all my friends saying merry Christmas by writing some code in SAS and sending that too with SAS.
In the process of sending wishes i am getting some ODD results from SAS.Can any one please get me out of this problems and lets me to send greetings to all..
I was wrote bellow code..
options symbolgen ;
filename mail email from = "firstname.lastname@example.org"
CT = "TEXT/HTML";
ods _all_ close;
ODS LISTING CLOSE;
ODS HTML BODY = mail RS=NONE STYLE = NORMAL;
file print ;
put "<body bgcolor='biyg'>";
put "<center><IMG SRC='C:\Users\sanjeevK\Desktop.JPG' <br></center>" ;
put "<h2><left><font size='+6' face='monotype corsiva' color='magenta'><BLINK><b>MERRY CHRISTMAS </b></BLINK></font></left></h2>";
put @22"<font size= '+1' color='bio'><blink>@</blink></font>";
do i=0 to 18;
put @(20-i) "<blink>* </blink><font size=2pt color= green >" b "</font><blink>*</blink>";
put @23'|| ||';
put @23'|| ||';
ODS html close;
Above code was executing with out any error and warning and i am getting the mail also...
But the mail not showing what actually i was sent..
Here i am attaching my mail and i desired output which needs to be show in the mail..
Please help me on this..
Thanks in Advance..
12-23-2012 06:39 AM
I ran this Code in both SAS 9.2 and SAS EG4.1,Both giving almost same result...
And in my above code i wrote "ODS HTML BODY="C:\Users\sanjeevK\test.HTML" instead of writing "ODS HTML BODY = mail RS=NONE STYLE = NORMAL;"..
A HTML file was creating in the Specified path and CHRISTMAS tree was displaying but "*" symbol was not blinking(i wrote * in blink tag in above code)..
12-23-2012 12:57 PM
As far as I know, the HTML spec says that an HTML file can have only 1 <BODY> tag. ODS HTML writes a <BODY> tag and your code writes a <BODY> tag. In addition, this article implies that the <BLINK> tag doesn't work for images: HTML Shop of Horrors: Blink Tag | TechRepublic and this article implies that the <BLINK> tag could be harmful: http://boingboing.net/2010/04/08/blink-tag-considered.html . And, I'm not sure what this W3C snippet refers to, but it seems odd: http://www.w3.org/Style/HTML40-plus-blink.dtd; however, this info on the W3C site seems to imply that you should not use <BLINK>: HTML/Elements/blink - W3C Wiki .
Using BODY=email will only cause the HTML text to be written to the email. Images are pointed to with the SRC= attribute of an <IMG> tag. Since your <IMG> tag points to your local C: drive, unless EVERY person who gets your mail has access to your personal C: drive, they won't see the IMAGE tag. Or, you use a relative reference in your <IMG> tag, and you attach the image to your email.
Perhaps you could send the greetings of the season a different way.
12-24-2012 04:18 AM
Thank you for your prompt..
I forgot to mention one things in my above post.
I Executed same code(which mentioned in my earlier post) in SAS EG 4.3,And i opened my mail box in Mozilla Thunderbird.mail body showing perfectly what i am looking for,and even Blinking also happening for " * "..
Why this is not happening in Gmail ??
Any Idea on this????
12-24-2012 09:55 AM
Well, that tells me that 1) the problem isn't a SAS problem, it's a rendering problem. And 2) it tells me that there's something different between Mozilla and Gmail. So, my guess would be that 3) the the folks at Google don't allow non-conforming HTML tags. However, the question "Why this is not happening in Gmail" is a question for Google Tech Support or Gmail Tech Support. Otherwise, it's just a guess as to why it works in Mozilla and not in Gmail.