【发布时间】:2015-09-18 11:39:44
【问题描述】:
如何设置mailitem.sender为账户邮箱..
每个帐户可以有多个邮箱。我可以访问所有 smtp 帐户,但无法将其邮箱设置为 mailitem.sender
我们可以使用的 Outlook 邮箱 Outlook.Session.Folders
【问题讨论】:
如何设置mailitem.sender为账户邮箱..
每个帐户可以有多个邮箱。我可以访问所有 smtp 帐户,但无法将其邮箱设置为 mailitem.sender
我们可以使用的 Outlook 邮箱 Outlook.Session.Folders
【问题讨论】:
MailItem 类的SendUsingAccount 属性允许设置一个Account 对象,该对象表示要发送MailItem 的帐户。例如:
Sub SendUsingAccount()
Dim oAccount As Outlook.account
For Each oAccount In Application.Session.Accounts
If oAccount.AccountType = olPop3 Then
Dim oMail As Outlook.MailItem
Set oMail = Application.CreateItem(olMailItem)
oMail.Subject = "Sent using POP3 Account"
oMail.Recipients.Add ("someone@example.com")
oMail.Recipients.ResolveAll
oMail.SendUsingAccount = oAccount
oMail.Send
End If
Next
End Sub
【讨论】: