BookmarkSubscribeRSS Feed
anandbillava
Fluorite | Level 6
Does anybody know how to send email which has embeded image with some text in it. I am able to send mail with attachments. But the image which is an attachment not embeded in the body of the email. Can somebody help me.
12 REPLIES 12
CurtisMack
Fluorite | Level 6
We have a similar need, but our solution might not suit your needs because we could not figure out how to imbed the images in the email message itself. We instead put the images on a web server and then created an HTML document that contained references to these images. The email was then created using a email file with the type='text/html' option and the html was written to it.

filename SendMail email to=("my.customer@overthere.com")
from='joe.shmoe@anywherecom'
type='text/html'
subject="Here is my email";

data outfile;
length line $ 4000;
infile "c:\MyHTMLBaseEmal.html" lrecl=4000 TRUNCOVER;
input line $ 1 - 4000;
run;
data _null;
file SendMail;
set outfile;
put line;
run;

The user gets an email with the images shown inline, but they may need to click something autorizing their email client to download the images. Message was edited by: Curtis Mack
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
The last reply shows a DATA step approach to "push" the HTML document only -- I don't see where there is any embedded image file being referenced, only the HTML tag file.

Scott Barry
SBBWorks, Inc.
CurtisMack
Fluorite | Level 6
Please read my post, I said exactly that. The HTML being sent contains img tags with the "src" pointing to images we have on our web server. The images are not "imbeded" in the email, but they do apear inline in the email message.

For example like I did to get this image to show in this post:


alt="Widget showing MB sales." />

Message was edited by: Curtis Mack Message was edited by: Curtis Mack
anandbillava
Fluorite | Level 6
Did you use emailsys as SMTP ?
CurtisMack
Fluorite | Level 6
Yes, we have an SMTP passthrough server set up just for generating messages in code like this.
CurtisMack
Fluorite | Level 6
We have the following options set when we open SAS:

-emailhost "smtp.nwcsr.com" -emailsys smtp

Of course the url of the smtp server would depend on your environment.
anandbillava
Fluorite | Level 6
Thanks for taht. Yes if you dont specify SMTP option then the mail wont support html content type.
CurtisMack
Fluorite | Level 6
If anyone has figured out how to imbed the images in the email message from within SAS, I would love to know how. I spent some time on it, and I think it would require understaning how the reference an attachment from within a message, or the use of imbeded MIME encoding, or both. What I offered is a work-around that got the job done for us.
anandbillava
Fluorite | Level 6
HI Mark,
According to my discussino with SAS Tech support its not possible with current releases of SAS. They are currently working on possibility of developing it. If this is possible then it will be in the next release of SAS.
CurtisMack
Fluorite | Level 6
Thanks, now I won't try to figure it out in my spare time (not that that would ever happen 🙂 ).
anandbillava
Fluorite | Level 6
Hello,

When I sent email with image as a hyper link my mail shows a message saying you need to download the image and its prevented as part of privacy settings. CAn this be overrruled through program.

Thanks,
Ananda
CurtisMack
Fluorite | Level 6
I mentioned that this was a problem with this method. I don't think there is a way around it because it is a security feature of the email client, and it would be a pointless feature if the sender could over-ride it.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 12 replies
  • 4613 views
  • 0 likes
  • 3 in conversation