In chapter 9, page 319 and 323, I keep getting the error "5.7.1 Authentication Required" using verizon.net mail services. I hate sending this message because I think I need information from verizon. My problem is I'm getting answers like "Can't you add authentication in your code?" Can someone help me solve this problem or give me a succinct question I can ask so that verizon will understand what I need?
I'm using port 25 because the last verizon tech suggested it.
Code:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="Dan McCrady <danmccrady@verizon.net>">
<network host="outgoing.verizon.net" userName="danmccrady" password="XXXXXXX"
port="25" />
</smtp>
</mailSettings>
</system.net>
Code:
Imports System.IO
Imports System.Net.Mail
Partial Class Controls_ContactForm
Inherits System.Web.UI.UserControl
Protected Sub Send_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Send.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("##Phone##", PhoneNumber.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("DanMcCrady@verizon.net", "Dan McCrady")
myMessage.To.Add(New MailAddress("DanMcCrady@verizon.net", "Dan McCrady"))
Dim mySmtpClient As SmtpClient = New SmtpClient()
mySmtpClient.Send(myMessage)
Message.Visible = True
FormTable.Visible = False
End If
End Sub
End Class