Sending an email in C# -


is possible send email in c# console, without needing , smtp server?

edit: why need smtp server? can not use localhost machine server..?

edit:
i need send email domain name, example abc@mydomain.com

is possible? need in c# program... not care receiving emails, care sending them....

thanks

you don't have depend on local smtp server if don't have one. however, have connect smtp server anyway. here why.

you must achieve following steps:

  • determine mail exchange servers of given domain.
  • connect mail exchange server , deliver mail.

those steps done local smtp server. advantage of local smtp server handle queue , continue try deliver email if fail.

how determine mx records of give domain.

i suggest have @ answer. basically, have query on dns server list of mx records of domain name of email address want send email to.

how connect mail exchange server

well answer disappoint you. connect local smtp server. using tcpclient, connect 1 of mail exchange server got @ previous step on port 25 , start delivering process using smtp protocol.

the trick here must handle multiple mx servers. listed preference. if first 1 unreachable, try next 1 , on...

that smtp server can handle too.

if want build logic yourself, please have @ directsend method of smtpclient class of open source project i'm involved in.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -