Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 6th, 2011, 12:11 PM
Authorized User
 
Join Date: Feb 2010
Posts: 42
Thanks: 9
Thanked 0 Times in 0 Posts
Default 5.7.1 Authentication Required

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 &lt;danmccrady@verizon.net&gt;">
     <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
 
Old January 6th, 2011, 12:26 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Looks like you're doing the right things already. Setting the user name and password is the way to go. Two things I can think of why this doesn't work:

1. Your user name may not be complete and should be something like danmccrady@verizon.net or another domain.

2. They require you to use SSL in which case you can set the enbleSsl attribute and change the port number (typically 587, but Verizon may use a different port).

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 6th, 2011, 01:29 PM
Authorized User
 
Join Date: Feb 2010
Posts: 42
Thanks: 9
Thanked 0 Times in 0 Posts
Default

Imar,

I had already tried enabling SSL and that clearly wasn't going to get past this problem.

I called Verizon's "advanced tech support" and they said it cannot be the username or password and this was out of their scope - issue closed. I took another try at it by changing the password and it now works. Thanks for the idea - maybe Verizon should send you a check!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Based Authentication instead of Windows authentication ocn BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 8 January 8th, 2010 07:28 PM
Some help required ! codenet C# 2005 1 September 24th, 2007 04:01 PM
Proxy Authentication Required in ASP.Net appln. rajbiswas76 General .NET 2 March 2nd, 2007 09:12 AM
Ch 11 SMTP SendMail Authentication Required sixiron BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 0 November 11th, 2006 09:57 AM
Help required for Directory Authentication MSUser General .NET 2 March 29th, 2004 03:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.