【发布时间】:2018-07-24 18:58:48
【问题描述】:
我有以下 VBA 可以很好地发送电子邮件:
With Sendrng
' Select the worksheet with the range you want to send
.Parent.Select
'Remember the ActiveCell on that worksheet
Set rng = ActiveCell
'Select the range you want to mail
.Select
' Create the mail and send it
ActiveWorkbook.EnvelopeVisible = True
With .Parent.MailEnvelope
' Set the optional introduction field thats adds
' some header text to the email body.
.Introduction = ""
With .Item
.To = "123@321.com"
.CC = ""
.BCC = ""
.Subject = "A new deli pre-order has been received."
.Send
End With
我现在苦苦挣扎的部分是设置电子邮件来自谁
我认为添加以下内容会起作用:
.From = "111@222.com"
添加上述内容时会发生什么: 根本收不到邮件
我错过了什么?
【问题讨论】:
标签: excel excel-2010 excel-2007 vba