Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 February 17th, 2011, 07:28 AM
Authorized User
 
Join Date: Feb 2011
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default CHP 9 : Email issue: Smtp server returned an invalid response.

Resolved Port issue to 465 and provider do require SSL.
Coded as such.
Think I am making connection but unable to interpret response.
Do u have something on this that can help?

Stack Trace:
Code:
[FormatException: Smtp server returned an invalid response.]
   System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) +1066247
   System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) +248
   System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) +16
   System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +642
   System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +159
   System.Net.Mail.SmtpClient.GetConnection() +35
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1213

[SmtpException: Failure sending mail.]
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1531
   Email.Page_Load(Object sender, EventArgs e) in c:\BegASPNET\Site\WebApplication1\WebApplication1\Demos\Email.aspx.cs:28
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

Code:Email Demo

Code:
public partial class Email : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
      MailMessage myMessage = new MailMessage();
      myMessage.Subject = "Test Message";
      myMessage.Body = "Hello world, from Planet Wrox";

      myMessage.From = new MailAddress("[email protected]", "Sender Name Here");
      myMessage.To.Add(new MailAddress("[email protected]", "Receiver Name Here"));

      SmtpClient mySmtpClient = new SmtpClient();
      mySmtpClient.EnableSsl = true;
      mySmtpClient.Send(myMessage);
    }
}
Web.config:
Code:
<system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from="You &lt;[email protected]&gt;">
        <network host="smtp.virginmedia.com" port="465" userName="[email protected]" password="myPW"/>
      </smtp>
    </mailSettings>
  </system.net>
 
Old February 17th, 2011, 07:31 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Not really. You could try accessing the mail server with telnet as explained here: http://support.microsoft.com/kb/153119 and see if you get a better error message.

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 February 17th, 2011, 11:46 AM
Authorized User
 
Join Date: Feb 2011
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Not really. You could try accessing the mail server with telnet as explained here: http://support.microsoft.com/kb/153119 and see if you get a better error message.

Cheers,

Imar
Doesnt really do much for me.
Will this be a blocker on me progressing further chapters if the email facility is not working?
 
Old February 17th, 2011, 12:21 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
Doesnt really do much for me.
As in: doesn't work? Or works? Or doesn't work but doesn't provide more details?

But no, you can easily continue. Just comment out the code with the call to Send(). You won't be able to reset your password, or get signup confirmation e-mails though.

As an alternative, you could set up a local drop folder as explained here: http://imar.spaanjaars.com/496/using...email-delivery

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 February 17th, 2011, 12:31 PM
Authorized User
 
Join Date: Feb 2011
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
As in: doesn't work? Or works? Or doesn't work but doesn't provide more details?

But no, you can easily continue. Just comment out the code with the call to Send(). You won't be able to reset your password, or get signup confirmation e-mails though.

As an alternative, you could set up a local drop folder as explained here: http://imar.spaanjaars.com/496/using...email-delivery

Cheers,

Imar
Doesnt work bud.
Will comment out Send for time being.

Many thanks.
 
Old February 17th, 2011, 12:58 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

What doesn't work? And why not? You need to provide a little more information if you want help ;-)

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 February 28th, 2011, 01:38 PM
Authorized User
 
Join Date: Feb 2011
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

I have now moved on to Chp15 which entails some email processes which I am unable to progress as a result of bypassing this solution.

Are you able to assist.

I previously tried telnet command as suggested but was not getting any fathomable response, i.e timing out......

Until fixed I am using the alternative method of local tempfile to send and pick up mails.

Last edited by Cooler; February 28th, 2011 at 01:54 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
The server response was: 5.7.0 Must issue a STARTTLS command first. 14sm672265ewy.3 ghadeer_ .NET Framework 3.5 4 May 23rd, 2010 10:57 PM
WebShop - SMTP Issue Keiko BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 November 1st, 2008 04:45 AM
the server returned an invalid or unrecognized res manojbhoyar ASP.NET 1.0 and 1.1 Basics 0 August 4th, 2008 01:48 AM
Sending email problem - SMTP server response: 554 Havokx Beginning PHP 0 July 27th, 2007 04:04 AM
Sending EMail thru SMTP server in C# - Most of the peri C# 1 December 20th, 2004 09:33 PM





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