07-20-2011 10:25 AM
I am trying to use MIME to send a mail with an PDF attachment which works fine, but I want to include some text in the body of the mail, which informs the recipient of the attachment. I can't see a way to send an existing text file with the attachment included, I always have to create a new blank file to add the attachment. How can I add some text to the body of the mail? See below some sample code I'm using:
$mail/noself/sub="Test" sys$login:email.txt smtp%"firstname.lastname@example.org"
Solved! Go to Solution.
07-20-2011 12:11 PM
You can do it this way.
Create a Text Document SYS_DAT:MIME_with_Body_Text.txt which starts with the body text.
(SYS_DAT is just a directory.)
$ type SYS_DAT:Mime_with_Body_Text.txt
Content-Type: text/plain; charset=ISO-8859-1
In the attachment you find the info.
Mail from an OpenVMS Company (DO NOT REPLY)
$ I have a PDF document SYS_DAT:PDF-Document.pdf
Create a MIME file with the Text document and add the PDF document.
MIME> OPEN/DRAFT SYS_DAT:MIME_with_Body_Text.TXT
MIME> ADD SYS_DAT:PDF-Document.pdf
$ mail/noself/sub="Test" SYS_DAT:MIME_with_Body_Text.txt smtp%"email@example.com"
No you should receive a email with body text and an attachment.
Just try it.
07-20-2011 12:50 PM
Excellent! Move to the front of the class, this works perfectly. Thanks very much for your help. Saved me a load of time trying to figure this out.