Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems w/ Email Authentication

Status
Not open for further replies.

jain747

Technical User
Apr 22, 2003
17
US
Hi,

I'm trying to use System.Web.Mail.MailMessage() to send emails, but I get this error: The server rejected the sender address. The server response was: 553 Authentication is required to send mail as <something@johndoe.com>. Should I be using another method rather then the one below?

Dim email As New System.Web.Mail.MailMessage()
email.To = &quot;RecipientAddress&quot;
email.From = &quot;SenderAddress&quot;
email.Body = &quot;MessageText&quot;
email.Subject = &quot;SubjectText&quot;
email.BodyFormat = Web.Mail.MailFormat.Text
System.Web.Mail.SmtpMail.SmtpServer = &quot;SmtpServerName&quot;
System.Web.Mail.SmtpMail.Send(email)

Thanks! Merry Christmas!!
 
Jain -- in a similar code snippet...

Dim myMail As New MailMessage()
myMail.From = &quot;from@microsoft.com&quot;
myMail.To = &quot;to@microsoft.com&quot;
myMail.Subject = &quot;UtilMailMessage001&quot;
myMail.Priority = MailPriority.Low
myMail.BodyFormat = MailFormat.Html
myMail.Body = &quot;<html><body>UtilMailMessage001 - success</body></html>&quot;
SmtpMail.Send(myMail)

...the code looks functionally similar to yours; nothing obvious at first glance. Are you incorporating the System.Web.Mail namespace?

 
You can try this: on your app web server, open the IIS consol, right click on &quot;Default SMTP Virtual Server&quot; and select &quot;Properties&quot;. In the &quot;Access&quot; tab, click on &quot;Relay&quot; button. Make sure that the &quot;Only the list below&quot; option is checked. Click the &quot;Add&quot; button and enter the localhost IP: 127.0.0.1. Hit &quot;OK&quot; to close both dialog boxes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top