<< Click to Display Table of Contents >> Navigation: GDI Print Directives > Email > Examples |
The following directive causes the PC's default mail client (typically Outlook Express) to be displayed, and the PDF file to be attached. The email has no address, no cc, no subject; those values must be filled in by the user, who must also manually send the message.
//PDFX,Email.Method,5
These directives cause the PC's default mail client to build and send a message with (theoretically) no user interaction. The message is sent to Ty and Jack with courtesy copies to various other addresses, has the subject of "PDF Testing," and has a message content (body) of "This is the text...". Note that due to security considerations, most email client programs (e.g. Outlook) will pop up a message box asking for your permission to permit this kind of email (which may reduce the efficiency and distinction between Email.Method 5 and Email.Method 6).
//PDFX,Email.Method,6
//PDFX,Email.To,"ty@microsabio.com,jack@microsabio.com"
//PDFX,Email.CC,"other1@microsabio.com,other2@microsabio.com,other3@microsabio.com"
//PDFX,Email.Content,"This is the text that will appear in the body of the email message."
//PDFX,Email.Subject,"PDF testing"
The following is a hybrid of the two examples above: it runs the user interface for the PC's default email client, preloads "PDF testing" as the subject, and then waits for the user to provide an address and manually send the message.
//PDFX,Email.Method,5
//PDFX,Email.Subject,"PDF testing"
• | A-Shell will maintain a log file of Email.Method 4 messages sent. The default log file is OPR:SMTP.LOG. You can change that with the above statement. To deactivate the log entirely, set logfile to "". |
• | Email.Type,4 will override subsequent Email.Method directives, so you can effectively convert existing program-generated files to use Email. Method 4 without modifying the programs. For example, you could create a prefix file, say, ASHCFG:PDFX.PFX which contains: //PDFX,Email.Type,4 and then add PREFIX=ASHCFG:PDFX.PFX to any printer init files that use DEVICE=PDFX... |
Following is a known-to-be-good report that uses Email. Method 4 / SMTP emailing. To test your email using this report, be sure to substitute in real data for the <your data here> notes in the file, and please replace our email addresses with similar ones of your own.
//PDFX,Email.Method,4
//PDFX,Email.SMTP.Address,<your data here, like "smtp.xxx.com">
//PDFX,Email.SMTP.UserName,<your data here>
//PDFX,Email.SMTP.Password,<your data here>
//PDFX,Email.SMTP.Port,25
//PDFX,Email.SMTP.UseSSL,1
//PDFX,Email.Content,"Hello world"
//PDFX,Email.Content,"This is a second content line"
//PDFX,Email.To,"Jack McGregor <jack@microsabio.com>, Joaquin <joaquin@microsabio.com>"
//PDFX,Email.From,"jack@microsabio.com"
//PDFX,Email.CC,"juan@microsabio.com"
//PDFX,Email.BCC,"microsabio@gmail.com"
//PDFX,Email.Subject,"Test new Email Type 4"
//PDFX,Email.AttachFile,sys:ersatz.ini
//PDFX,Email.AttachFile,c:\archives\rules.pdf
//PDFX,Email.AttachFile,"%MIAME%\pictures\portrait.jpg"
This is the actual report, converted to PDF.
This is line 2 of the report.
This is line 3 of the report.
This is the end