cdemott33
asked on
Help with "Mailbox unavailable." error
Hi Experts -
I'm trying to send an email via an asp.net script and I'm getting the following error.
Mailbox unavailable. The server response was: 5.7.1 Relaying to <johnsmith@gmail.com> denied (authentication required)
Can someone please tell me what I'm doing wrong?
PS: My script ONLY works if I'm sending the message to someone WITHIN my domain. Anyone on the outside my domain (i.e. HotMail, Gmail, Yahoo, etc.) will throw this error.
I'm trying to send an email via an asp.net script and I'm getting the following error.
Mailbox unavailable. The server response was: 5.7.1 Relaying to <johnsmith@gmail.com> denied (authentication required)
Can someone please tell me what I'm doing wrong?
PS: My script ONLY works if I'm sending the message to someone WITHIN my domain. Anyone on the outside my domain (i.e. HotMail, Gmail, Yahoo, etc.) will throw this error.
' Create the MailMessage instance
Dim mail As New MailMessage()
' FROM:
mail.From = New MailAddress("confirmation@mycompany.com", "Company Solutions")
' TO:
mail.To.Add(strEmailAddress)
' SUBJECT & BODY
mail.Subject = MailSubject
mail.Body = mailText
mail.IsBodyHtml = True
' Create the SmtpClient object
Dim smtp As New SmtpClient
'(4) Send the MailMessage (use the Web.config settings)
smtp.Send(mail)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your help. Those articles were helpful
Try adding the 2 new lines shown in the attatched snippet.
Open in new window