I see different versions of the constructor, one uses info from web.config, one specifies the host, and one the host and port. But how do I set the username and password to
The SmtpClient can be used by code:
SmtpClient mailer = new SmtpClient(); mailer.Host = "mail.youroutgoingsmtpserver.com"; mailer.Credentials = new System.Net.NetworkCredential("yourusername", "yourpassword");