To resolve this issue, you must specifically assign the value of the SMTP server that you are using to send the e-mail message. Assign the value to the SmtpMail.SmtpServer property directly. For example, use code that resembles the following:
SmtpMail.SmtpServer = "mail.mycompany.com";