How to send email in Outlook on behalf of a Delegate?

前端 未结 1 1795
醉梦人生
醉梦人生 2021-01-15 12:21

I\'m writing a VBA script that will fire off emails to our customers. I\'ve made similar systems before, but the difference here is that these emails will use a generic Fro

相关标签:
1条回答
  • 2021-01-15 12:30

    Check out the MailItem.SentOnBehalfOfName Property. You should have delegate access to the mailbox/profile on whose behalf you want to send.

    Example:

    Sub SendEmailOnBehalf()
      Dim msg As Outlook.MailItem
    
      Set msg = Outlook.CreateItem(olMailItem)
      With msg
        .SentOnBehalfOfName = "Jimmy's boss' name"
        .Subject = "Email from someone else"
        .Body = "Hello" & vbNewLine 
      End With
    End Sub
    

    The email would say From Jimmy Pena on behalf of Jimmy's Boss in the From: field.

    0 讨论(0)
提交回复
热议问题