Saturday, December 13, 2014

Specify the port when sending an email with an SmtpClient in C#?

SmtpClient smtpAgent = new SmtpClient();
smtpAgent.Host = "smtp.example.com";
smtpAgent.Port = 587;

No comments:

Post a Comment