 |
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
|
|
|
|
|

February 17th, 2011, 07:28 AM
|
|
Authorized User
|
|
Join Date: Feb 2011
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 <[email protected]>">
<network host="smtp.virginmedia.com" port="465" userName="[email protected]" password="myPW"/>
</smtp>
</mailSettings>
</system.net>
|
|

February 17th, 2011, 07:31 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

February 17th, 2011, 11:46 AM
|
|
Authorized User
|
|
Join Date: Feb 2011
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Imar
|
Doesnt really do much for me.
Will this be a blocker on me progressing further chapters if the email facility is not working?
|
|

February 17th, 2011, 12:21 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

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

February 17th, 2011, 12:58 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
What doesn't work? And why not? You need to provide a little more information if you want help ;-)
Cheers,
Imar
|
|

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