c# - Send email with FQDN including directory -
i'm trying send email c#. our email provider suggested use mail.example.com/exchange
instead of mail.example.com
string mailserver; mailserver = "mail.example.com"; mailserver = "mail.example.com/exchange"; smtpclient smtpclient = new smtpclient(mailserver); smtpclient.deliverymethod = smtpdeliverymethod.network; smtpclient.credentials = new networkcredential("username", "password"); smtpclient.send("from@example.com", "to@foo.com", "subj", "email body");
when mailserver
not include directory, after long pause, get:
system.net.mail.smtpexception: failure sending mail. ---> system.net.webexception: unable connect remote server ---> system.net.sockets.socketexception: connection attempt failed because connected party did not respond after period of time, or established connection failed because connected host has failed respond
when mailserver
include directory, no pause @ all, get:
system.net.mail.smtpexception: failure sending mail. ---> system.net.webexception: remote name not resolved: 'mail.example.com/exchange'
how can send email c# fqdn includes directory?
smtp doesn't support concept of directories, might want email provider knows they're talking about.
Comments
Post a Comment