Imar, really appreciate your responding to my question. Following is the code in the config file (password x'ed out):
Code:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="Nelson Miller <[email protected]>">
<network host="mail.ndmiller.net" userName="[email protected]" password="XXXXX" port="50" />
</smtp>
</mailSettings>
</system.net>
Here is the code I have in the send button in the contacts page:
Code:
Protected Sub SendButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SendButton.Click
If Page.IsValid Then
Dim fileName As String = Server.MapPath("~/App_Data/ContactForm.txt")
Dim mailBody As String = File.ReadAllText(fileName)
mailBody = mailBody.Replace("##Name##", Name.Text)
mailBody = mailBody.Replace("##Email##", EmailAddress.Text)
mailBody = mailBody.Replace("##HomePhone##", PhoneHome.Text)
mailBody = mailBody.Replace("##BusinessPhone##", PhoneBusiness.Text)
mailBody = mailBody.Replace("##Comments##", Comments.Text)
Dim myMessage As MailMessage = New MailMessage()
myMessage.Subject = "Response from web site"
myMessage.Body = mailBody
myMessage.From = New MailAddress("[email protected]", "Nelson M.")
myMessage.To.Add(New MailAddress("[email protected]", "N. Miller"))
Dim mySmtpClient As SmtpClient = New SmtpClient()
mySmtpClient.Send(myMessage)
Message.Visible = True
MessageSentPara.Visible = True
FormTable.Visible = False
System.Threading.Thread.Sleep(5000)
End If
End Sub
End Class
When I click the send button I get an error that the mailbox is unavailable and not on this server. If I change the "to" address to
[email protected] it does work. I also have the same problem in chapter 15 when I am trying to send a email to a new user after they have just signed up.
thanks again,
Nelson