How do I send emails outside my domain with Exchange 2007 and c#

前端 未结 4 2216
情歌与酒
情歌与酒 2021-02-10 05:43

I am able to send emails using the typical C# SMTP code across Exchange 2007 as long as both the from and to addresses are within my domain.

As soon as I try to send ema

4条回答
  •  离开以前
    2021-02-10 06:33

    Try #2... How about using a Exchange Pickup Folder instead? They are a faster way to send emails through Exchange because it just creates the email and drops it in the folder, no waiting to connect to the server or waiting for a reply. Plus I think it skips the whole relay issue.

    Configure youur SmtpClient like so:

    SmtpClient srv = new SmtpClient("exchsrv2007", 25) {
        DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory,
        PickupDirectoryLocation = "\\exchsrv2007\PickupFolder"
    }
    ...
    

提交回复
热议问题