Excel 可以在Sentonbehalfofname中使用文本字符串吗?

Excel 可以在Sentonbehalfofname中使用文本字符串吗?,excel,outlook,vba,Excel,Outlook,Vba,我想从我的帐户使用VBA发送电子邮件,但似乎是从其他用户发送的。有没有一种方法可以使用Sentonbehalfofname,这样您就可以在没有访问权限的情况下包含任何您想要的文本字符串 Set outlookapp = CreateObject("outlook.application") msg = "Enter Message here" subject = "Enter subject here" Set item = outlookapp.createitem(0) With item

我想从我的帐户使用VBA发送电子邮件,但似乎是从其他用户发送的。有没有一种方法可以使用Sentonbehalfofname,这样您就可以在没有访问权限的情况下包含任何您想要的文本字符串

Set outlookapp = CreateObject("outlook.application")
msg = "Enter Message here"
subject = "Enter subject here"
Set item = outlookapp.createitem(0)

With item
.Sentonbehalfofname = "Yogi Bear"

谢谢,

否,Exchange Server会将该名称解析为邮箱,并检查您是否有权代表该邮箱发送

如果您使用的是SMTP服务器,则可以指定任意名称,但这仅适用于某些SMTP服务器,而不适用于Exchange。

.From=“”您的字符串”“"
.From = """Your string""  < sender@email.com>"