Unable to relay with system.web.mail

From: Chris Thunell (cthunell_at_pierceassociates.com)
Date: 05/27/03


Date: Tue, 27 May 2003 08:15:48 -0400


I have some code where I send some email. If I send an email to an internal
receipient, it works great. If I trend to send to someone outside our
organization I get "The server response was: 550 5.7.1 Unable to relay for
chrisworking@yahoo.com". If I turn off Anonymous Authentication on my SMTP
Exchange 2000 server I get another error, "The server response was: 454
5.7.3 Client was not authenticated".

I need a way to pass logon information with the following code (Any ideas
would be greatly appreciated!):

Imports System.Web.Mail

'time to send email now
Dim message As New MailMessage()
With message
.BodyFormat = MailFormat.Html
.To = RecipientList
.Cc = MessageFrom
.Subject = MessageSubject
.From = MessageFrom
.Body = MessageBody
End With
SmtpMail.SmtpServer = "MyEmailServer.MyDomain.com"
SmtpMail.Send(message)

Thanks again for any help!
Chris Thunell
cthunell@pierceassociates.com