Page 1 of 1

Sending Emails with attachment

PostPosted: Fri Jun 17, 2011 12:29 pm
by maragatham pp
Hi,

I have been able to send an email. But this time I have been asked to send a file as an attachement to the email.

The logic I applied is
1) created a file with Generic Email format with TO, SUBJECT and
Content-Disposition: attachment; filename="MISMATCH_RPT.txt".
2) concatenated the above to the actual Mainframe file( which needs to be sent as attachment).
3) The concatenated file was SMTP'd.

Although I received an Email, the contents of the file were displayed on the email and was not sent as an attachement.

Kindly revert if I have to provide any further info to resolve this.

Re: Sending Emails with attachment from Mainframe

PostPosted: Fri Jun 17, 2011 2:47 pm
by NicC
Did you search the forum first - that is one of the rules. Another rule is to state what you have tried but as you have not stated anything perhaps you have not tried any diagnosis at all so why should we do it for you. Your lucky day: try this post found by a simple search of the JCL section of the forum using 'e-mail attachment' as the search key.

Re: Sending Emails with attachment from Mainframe

PostPosted: Fri Jun 17, 2011 3:01 pm
by Robert Sample
Sending email with attachments from the mainframe is done at our site every day. It is not that hard, but SMTP is extremely sensitive to the nuances and if you don't have everything exactly right, the email (or attachment) is not sent. And as Nic said, if you want more assistance you are going to have to post the exact JCL you are using -- not a copy, not a retyping, the exact JCL cut and pasted using the Code tag to preserve spacing. Get rid of IP addresses and precise domain names, but leave everything else exactly the same.

Google is your friend. Google RFC 2822 or RFC 2821 to find out more about the email process, and follow some of the links in these standards to find out about attachments to emails.

Re: Sending Emails with attachment from Mainframe

PostPosted: Fri Jun 17, 2011 3:08 pm
by MrSpock