Help
Jim Pistrang
jim at jpcr.com
Tue Jan 26 18:16:44 EST 2010
Hi Hopema,
>Please send me some examples how to use a mime list with SMTP command
>Hopema
Maybe this will help....
In this example, the following parameters are passed in:
pvUser - user name
pvSubject - subject of the email
pvBody - body of the email
pvFrom - 'from' email address
pvTo - 'to' email address
pvPath - the path name to the file
pvFileName - the name of a file
*********************************************************
Calculate %%server as tvVar.cvMailserver
Calculate %%subj as pvSubject
Calculate %%body as pvBody
Calculate %%user as tvVar.cvSmtpUser
Calculate %%password as tvVar.cvSmtpPassword
Do lvEnclosureList.$define(lvFileName,lvFilePath)
Do lvEnclosureList.$add(pvFileName,pvPath)
Do lvMimeList.$define(lvLevel,lvConte
ntType,lvContentSubType,lvFileName,lvCharData,lvBinData,lvCharSet,lvEncoding)
Do lvMimeList.$add(0,'multipart','mixed')
Do lvMimeList.$add(1,'text','plain',,pvBody,,,)
For %loop from 1 to lvEnclosureList.$linecount step 1
Do lvEnclosureList.$line.$assign(%loop)
Do lvEnclosureList.$loadcols()
Do lFileOps.$openfile(lvFilePath)
Do lFileOps.$readfile(lvBinData)
Do lFileOps.$closefile()
Do lvMimeList.$add(1,'application','octet-stream',lvFileName,,lvBinData,,)
End For
SMTPSend (%%server,%%from,%%to,%%subj,lvMimeList,%%cc,%%bcc,,,5,,%%user,%
%password) Returns %%status
*********************************************************
--
Jim Pistrang
JP Computer Resources
Certified Member, Apple Consultants Network
413-256-4569
<http://www.jpcr.com>
More information about the omnisdev-en
mailing list