简体   繁体   English

从 Outlook 中的辅助电子邮件帐户发送

[英]Sending from secondary email account in outlook

I have an excel spreadsheet with some VBA that will send a marketing email to everyone with an email address in a spreadsheet.我有一个带有一些 VBA 的 excel 电子表格,它将向每个人在电子表格中使用电子邮件地址发送营销电子邮件。

When I send it through my main account it works absolutely perfectly but when I try to send it through our 'marketing@' email account, it only sends back to that account.当我通过我的主帐户发送它工作万无一失了,但是当我试图通过我们的营销@“电子邮件帐户发送,只发送该帐户。

The emails send from my account (correctly) and appear in my sent items and when they are received in the marketing@ account, the reply address is marketing@ so everything appears to be working.从我的帐户发送的电子邮件(正确)并出现在我发送的项目中,当它们在marketing@ 帐户中收到时,回复地址是marketing@,所以一切似乎都在工作。 It is just not sending to the recipient.它只是不发送给收件人。

I have permission to SendAs in Exchange and this works (if I try a different address I get an access denied error message) but cannot work out why this isn't working for me at all.我有在 Exchange 中使用 SendAs 的权限,这有效(如果我尝试不同的地址,我会收到拒绝访问的错误消息),但无法弄清楚为什么这对我不起作用。

This is my code:这是我的代码:

 Private Sub StackOverflow()
  Dim OlApp As Outlook.Application
  Dim olMail As Outlook.MailItem

    Set OlApp = New Outlook.Application
    Set olMail = OlApp.CreateItem(olMailItem)
    With olMail
      .SentOnBehalfOfName = """Marketing"" <marketing@>"
      .To = "Recipient"
      .Subject = "Test"
      .Body = "Test"
      .Display
    End With

  Set olMail = Nothing
  Set OlApp = Nothing
End Sub

What changes I need to make to this code to get it to send to the recipient and not back to the account I'm sending from?我需要对此代码进行哪些更改才能将其发送给收件人而不是返回到我发送的帐户?

This has now been solved and it's nothing to do with Excel or Outlook.现在已经解决了,和 Excel 或 Outlook 无关。

It seems that somehow, a rule was placed on the server that re-routed anything sent from this account to the account instead.似乎不知何故,在服务器上放置了一条规则,该规则将从该帐户发送的任何内容重新路由到该帐户。 Now this rule has been removed, the code works perfectly.现在这条规则已被删除,代码完美运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM