I am trying to add email subsribers to the listserv and I am getting the below error message. can someone help
Mailbox unavailable. The server response was: Relaying denied
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: Relaying denied
Source Error:
Line 30:
Line 31: Dim SmtpMail As New SmtpClient()
Line 32: SmtpMail.Send(mailDelivery)
Line 33: End Sub
Line 34:
Code:
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Dim strEmailAddress As String = txtEmailAddress.Text.Trim.ToString.ToLower
Dim strName As String = txtName.Text.Trim.ToString
Dim mailDelivery As New MailMessage
If RadioButtonList1.SelectedIndex = 0 Then
mailDelivery.Subject = "Subscribe"
mailDelivery.Body = "subscribe testlist" & strName & vbCrLf
Response.Write("Thank you. You should receive a confirmation email about your subscribtion shortly.")
Else
mailDelivery.Subject = "Unsubscribe"
mailDelivery.Body = "unsubscribe testlist " & vbCrLf
Response.Write("Thank you. You will be removed from the HPDP mailing list")
End If
mailDelivery.From = New MailAddress(strEmailAddress)
mailDelivery.To.Add(New MailAddress("listserv@.xxx.xxxxx.xx.xx"))
mailDelivery.IsBodyHtml = False
Dim SmtpMail As New SmtpClient()
SmtpMail.Send(mailDelivery)
End Sub
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: Relaying denied
Source Error:
Line 30:
Line 31: Dim SmtpMail As New SmtpClient()
Line 32: SmtpMail.Send(mailDelivery)
Line 33: End Sub
Line 34: