In Outlook, and most email programs, you can send an email message with the address firstname.lastname@example.org through otherdomain.com so long as you login to the smtp server with the correct credentials. I am having trouble doing this with MailMessage. Even though I have smtp.Credentials = New System.Net.NetworkCredential("email@example.com", "password"), the message fails with the error "Mailbox unavailable. The server response was: Verification failed for <firstname.lastname@example.org>". Why isn't it trying to authenticate with the correct account? Can anyone tell me what I am doing wrong? Here is the code:
Dim msg As New MailMessage
Dim smtp As New SmtpClient
msg = New MailMessage
smtp = New SmtpClient("otherdomain.com")
.IsBodyHtml = True
.From = New MailAddress("email@example.com")
.To.Add(New MailAddress("Some Person <firstname.lastname@example.org>")
.Subject = "Form Confirmation"
.Body = "test"
.Priority = MailPriority.High
smtp.Credentials = New System.Net.NetworkCredential("email@example.com", "password")