IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Mail via SMTP with an image?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mike 1304

New User


Joined: 15 Oct 2011
Posts: 46
Location: Germany

PostPosted: Thu Jan 26, 2017 2:01 pm
Reply with quote

Today we send mails as html text using ICEGENER
//SYSUT2 DD SYSOUT=E,DEST=TCPSMTP.

Now I get a new request to add a company logo to the mail.
So I have to embed a image "logo.png" from a PC.

Is there any way to do this?

Mike
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jan 26, 2017 7:32 pm
Reply with quote

Look at using MIME with SMTP. It is possible to transfer binary data (such as images) using MIME under SMTP; whether or not that image will appear in the email or as an attachment is a different question.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Thu Jan 26, 2017 7:39 pm
Reply with quote

If you know SAS then you have a high possibility to achieve it.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Jan 27, 2017 6:15 am
Reply with quote

SMTP mail with embedded logo?? say no more fam..

Code:
HELO WELLS                                                           
MAIL FROM:<WELLS@DOGE.COM>                           
RCPT TO:<WELLS@DOGE.COM>                             
DATA                                                                   
FROM: WELLS@DOGE.COM                                 
TO: WELLS@DOGE.COM                                   
SUBJECT: THIS IS BROUGHT TO YOU BY DOGE                                 
MIME-VERSION: 1.0;                                                     
Content-Type: multipart/mixed; boundary="-------------...SuchCode"     
                                                                       
---------------...SuchCode                                             
Content-Type: multipart/related; boundary="-------------...MuchCompile"
                                                                       
---------------...MuchCompile                                           
Content-Type: text/html;                                               
                                                                       
<html>                                                                 
<body>                                                                 
<p> such code much compile </p>                                         
<p style="margin: 0; padding: 0"><img src="cid:wells.gif" alt="" /></p>
<p> very programs </p>                                                 
</body>                                                                 
</html>                                                                 
                                                                       
---------------...MuchCompile                                           
Content-type: image/gif; name="wells.gif"                               
Content-ID: <wells.gif>                                                 
X-Attachment-Id: wells.gif                                             
Content-Disposition: Embedded; filename="wells.gif"                     
Content-transfer-encoding: base64                                       

............................base64 encoded image here – LRECL 80.
.....................................................
---------------MuchCompile--   
---------------SuchCode--     


Output email is in the attachment.
Back to top
View user's profile Send private message
Mike 1304

New User


Joined: 15 Oct 2011
Posts: 46
Location: Germany

PostPosted: Fri Feb 24, 2017 12:10 pm
Reply with quote

Sorry for the late response caused by holidays..

It works fine!
I did the encoding with:
Code:

//STEP0090 EXEC PGM=USIBAS64                                         
//SYSOUX   DD SYSOUT=*                                               
//ENCODIN  DD DSN=BINARY.TRANSFERED.LOGO.PNG,DISP=SHR                 
//ENCODOUT DD DSN=BASE64.OUTPUT.FB80,DISP=SHR                         
//*         SPACE=(CYL,(2,2),RLSE),DCB=(LRECL=80,RECFM=FBA,DSORG=PS) 
//SYSOUT   DD SYSOUT=*                                               
//SYSUDUMP DD SYSOUT=*                                               
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts DB2 Table - Image copy unload IBM Tools 2
No new posts mail attachment with excel format All Other Mainframe Topics 2
No new posts TXT2PDF and then SMTP email a PDF JCL & VSAM 4
No new posts Send email without SMTP All Other Mainframe Topics 5
No new posts Unable to send mail via CSSMTP to GMA... JCL & VSAM 2
Search our Forums:

Back to Top