smtp - Check if mail was successfully sent in VB.NET with SMTPClient -
smtp - Check if mail was successfully sent in VB.NET with SMTPClient -
i'm trying create application sends email smtp-server.
the server not set fixed, looked according domainpart of email-address email should sent to.
example:
email to: test@stackoverflow.com
domain-part: stackoverflow.com
result of mx-record lookup (commandline "nslookup -type=mx stackoverflow.com":
stackoverflow.com mx preference = 30, mail service exchanger = stackoverflow.com.s9b1.psmtp.com stackoverflow.com mx preference = 40, mail service exchanger = stackoverflow.com.s9b2.psmtp.com stackoverflow.com mx preference = 10, mail service exchanger = stackoverflow.com.s9a1.psmtp.com stackoverflow.com mx preference = 20, mail service exchanger = stackoverflow.com.s9a2.psmtp.com
it quite useful, know if message accepted mailserver , message sent.
what able far is, can smtp-server error code (if there error (statuscode 5xx) using system.net.mail.smtpclient object , sendasync function. there, if there error, exception-object in callback-event of smtpclient
i'm aware not every mailserver tell me if mailaccount exists , reject mail service errorcode instead take message , delete it. hence grateful method check if mail service sent (note: not read, read confirmation)
the final purpose be: seek send email recipient using it's domains mailserver , if fails, proceed according errorcode (user not exist -> abort / mailserver did not respond -> utilize mailserver if available).
thanks in advance (and sorry typos :))
unfortunately looking not exist. email jumps through many hops there no definition of "sent" means. instance, illustration of stackoverflow points postini's email servers. postini passes email around gateways av's , routers. there either pool email or pass them on email server.
with email, closest definition of "sent" "at to the lowest degree didn't error".
also, minor thing, when using nslookup remember add together trailing period domain, otherwise domain search list used. not big deal every 1 time in while might trip up.
nslookup -type=mx stackoverflow.com.
vb.net smtp smtpclient
Comments
Post a Comment