There reason CDO2.0 avoids the security patch of Outlook is, it does not require Outlook to work. (Thank you Jonscott8 for this clarification)
Note #1 : This requires SMTP services installed and running on the local computer.
Note: If a mail server is involved (ie: Exchange server ) consider using the suggestions in FAQ184-1769.
oMSG = CREATEOBJECT('cdo.message')
oMSG.To = 'me@nowhere.com'
oMSG.From = 'me'
oMSG.Subject = 'Hello Email'
oMSG.TextBody = 'This is an easy way to create an email'
oMSG.Send()
release oMSG
*--带附件发送邮件
oMSG = createobject('CDO.Message')
oMSG.To = 'me@nowhere.com'
oMSG.From = 'me@nowhere.com'
oMSG.Subject = 'Hello Email'
oAtt=oMSG.AddAttachment('c:\myfile.txt')
oMSG.Send()
release oMSG
*--Here is a great way to embed your web page in your email:
CODEoMSG = createobject('CDO.Message')
oMSG.To = 'me@nowhere.com'
oMSG.From = 'me@nowhere.com'
oMSG.Subject = 'Hello Email'
oMSG.CreateMHTMLBody('http://www.slpcanada.com')
oMSG.Send()
release oMSG
*--发送HTML格式邮件
CODE
oMSG = createobject('CDO.Message')
oMSG.To = 'me@nowhere.com'
oMSG.From = 'me@nowhere.com'
oMSG.Subject = 'Hello Email'
oMSG.HTMLBody = [< b >< P >< FONT COLOR='#CC0000' >Hello In Color< /FONT >< /b >]
oMSG.Send()
release oMSG
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。