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

时间:2013-04-04 00:15:21

标签: excel-vba outlook vba excel

我想从我的帐户发送使用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"

谢谢,

2 个答案:

答案 0 :(得分:0)

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

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

答案 1 :(得分:0)

.From = """Your string""  < sender@email.com>"