I have created a Form to allow people who visit our website to email their friend about the site. I modified a form that we used for contacting us.
Everything worked until I wanted to put the person who is sending the email in the From or CC field and then it gave me the error:
The server rejected one or more recipient addresses. The server response was: 550 sorry, no mailbox here by that name (#5.1.1)
If I remove the Form Field under objMM.Cc it works just fine.
Here is the form:
I really appreciate the help.
Thanks,
Adam
Everything worked until I wanted to put the person who is sending the email in the From or CC field and then it gave me the error:
The server rejected one or more recipient addresses. The server response was: 550 sorry, no mailbox here by that name (#5.1.1)
If I remove the Form Field under objMM.Cc it works just fine.
Here is the form:
Code:
<script language="vb" runat="server">
Sub btnSendFeedback_Click(sender as Object, e as EventArgs)
'Create an instance of the MailMessage class
Dim objMM as New MailMessage()
'Set the properties - send the email to the person who filled out the
'feedback form.
objMM.To = frtxtEmail.Text [B](FORM FIELD)[/B]
objMM.From = "[email protected]"
'If you want to CC this email to someone else, uncomment the line below
objMM.Cc = txtName.Text [B](FORM FIELD)[/B]
'If you want to BCC this email to someone else, uncomment the line below
'objMM.Bcc = ""
'Send the email in text format
objMM.BodyFormat = MailFormat.Text
'(to send HTML format, change MailFormat.Text to MailFormat.Html)
'Set the priority - options are High, Low, and Normal
objMM.Priority = MailPriority.Normal
'Set the subject
objMM.Subject = ""
'Set the body
objMM.Body = ""
'Specify to use the default Smtp Server
SmtpMail.SmtpServer = "mail.MYSITE.com"
'Now, to send the message, use the Send method of the SmtpMail class
SmtpMail.Send(objMM)
panelSendEmail.Visible = false
panelMailSent.Visible = true
End Sub
</script>
I really appreciate the help.
Thanks,
Adam