I am using system.net.mail and don't quite understand the process of emailing. I have set the server to the company email server and can email fine within the company but if I try to email to an address outside the company I get the following error:
System.Net.Mail.SmtpFailedRecipientsException: Unable to send to a recipient. ---> System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for rob_b_harris1@hotmail.com
--- End of inner exception stack trace ---
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at FileWatcher.email.sendMail(String serverName, String recipient, String recip2, String recip3, String from, String bcc, String cc, Int32 priority, String subject, String body, Boolean doAuthentication, Boolean doCheckServer, String userName, String Password) in C:\Documents and Settings\rbharris\My Documents\Visual Studio 2005\Projects\FileWatcher\FileWatcher\email.vb:line 61
System.Net.Mail.SmtpFailedRecipientsException: Unable to send to a recipient. ---> System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for rob_b_harris1@hotmail.com
--- End of inner exception stack trace ---
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at FileWatcher.email.sendMail(String serverName, String recipient, String recip2, String recip3, String from, String bcc, String cc, Int32 priority, String subject, String body, Boolean doAuthentication, Boolean doCheckServer, String userName, String Password) in C:\Documents and Settings\rbharris\My Documents\Visual Studio 2005\Projects\FileWatcher\FileWatcher\email.vb:line 61