【发布时间】:2016-10-18 21:00:55
【问题描述】:
我正在使用 QTP Outlook 对象模型发送电子邮件。
这是一段代码。
'Create an object of type Outlook
Set objOutlook = CreateObject("Outlook.Application")
Set myMail = objOutlook.CreateItem(0)
'Set the email properties
myMail.To = "some_mail_id@gmail.com"
myMail.CC = "some_mail_id_2@gmail.com; some_other_mail@yahoo.com" 'Sending mails to multiple ids
myMail.BCC = "" 'If BCC is not required, then this line can be omitted
myMail.Subject = "Sending mail from MS Outlook using QTP"
myMail.Body= "Test Mail Contents"
myMail.Attachments.Add("D:\Attachment.txt") 'Path of the file to be attached
'Send the mail
myMail.Send
现在我需要检索发件人电子邮件地址并将其存储在环境变量中。 myMail.Sender 或 myMail.sendermailaddres 他们都对我不起作用。
【问题讨论】:
标签: vba email outlook send qtp