A new library of Amduus Classes I am putting together includes some code for sending email in Progress 10.1a or better programs.
Example call in HTML with embedded images and an attachment.
define variable M as com.amduus.mail.MailBySendmail no-undo.
define variable HTML as character no-undo.
M = new com.amduus.mail.MailBySendmail().
M:ToEmail = "sauge@localhost".
M:FromEmail = "root@localhost".
M:BCCEmail = "root@localhost".
M:Subject = "Test 1".
HTML = "<html><body>"
+ 'This is a <b>test</b> <img src="cid:y1"> email'
+ "</body></html>"
.
M:HTMLBody = HTML.
M:TextBody = "This is a text portion".
M:AttachFile ("/tmp/data.xml", "data.xml", ?).
M:AttachCID("y1", "/tmp/laptop-clipart.jpg", "").
M:SendMimeEMail ().
delete object M.
The code is also available at http://www.amduus.com under the same story header.
Attachment | Size |
---|---|
amduusclasses.2009063223318.zip | 14.41 KB |