Office中国论坛/Access中国论坛

标题: 如果e-mail邮件没有送出去,怎么写代码? [打印本页]

作者: sunredday    时间: 2004-7-23 05:02
标题: 如果e-mail邮件没有送出去,怎么写代码?
strCC = "someaddres@domain.com" & ";" & "anotheraddress@domain.com"

Set myOlApp = CreateObject("Outlook.Application")

Set myItem = myOlApp.CreateItem(olMailItem)

Set myRecipient = myItem.Recipients.Add("sunredday@126.com")

With myItem

   .Display

.To = "sunredday@163.com"    ' Who to send email to    '

.CC = strCC    ' Who gets CC .. if needed  抄送  '

.BCC = "address2@domain.com"    ' Who gets BCC .. if needed 密件抄送

.Importance = olImportanceHigh    'High importance    '

.Attachments.Add "C:\Documents and Settings\赵刚.F4ZZ75IGHBDHZGN\My Documents\分析化学.XLS" ' attachment 1    '

'.Attachments.Add "C:\FolderName\FileAttachment2.txt" ' attachment 2 ... if needed

.Subject = "Your Subject"

.Body = "Your Message"    '

.Display

.Send

End With

[此贴子已经被作者于2004-7-29 17:49:27编辑过]






欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3