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 March 10th, 2009, 04:16 PM
Registered User
 
Join Date: Mar 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Target machine refusing smtp email connection

I am having difficulty getting the email demo to work.
Any insight into how to get around the issue would be very welcome. I was going to just continue with the book, but then the following chapter builds on the email issue.

When I try to run the demo, I get the following error:
No connection could be made because the target machine actively refused it

My ISP is Verizon, and on their website they say the following:
"The SMTP setting for outgoing mail is outgoing.verizon.net."

Here is my code:
web.config:
<system.net>
<
mailSettings>
<smtpdeliveryMethod="Network"from="me@verizon.net">
<
networkhost="outgoing.verizon.net"userName="me"password="mypass" />
</
smtp>
</
mailSettings>
</
system.net>

Email.aspx.cs:
publicpartialclassDemos_Email : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
MailMessage myMessage = newMailMessage();
myMessage.Subject =
"Test Message";
myMessage.Body =
"Hello world, from Planet Wrox";
myMessage.From = newMailAddress("[email protected]");
myMessage.To.Add(
newMailAddress("[email protected]"));
SmtpClient mySmtpClient = newSmtpClient();
mySmtpClient.EnableSsl =
true;
mySmtpClient.Send(myMessage);
}
}


Thank you for any help you can provide.
 
Old March 10th, 2009, 06:04 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,

I think you need to talk to Verizon. Maybe they require SSL, maybe they don't require "Me" as the name, but "me @domainname.com", maybe your IP address / connection is not allowed to use that mail server and so on. Difficult to say from here, but they should be able to help you out. Maybe they have code examples or a FAQ on their site?

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 March 10th, 2009, 07:06 PM
Registered User
 
Join Date: Mar 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks.

I tried changing "me" to [email protected] and was rewarded with this error message:
Server does not support secure connections

I'll try to get in touch with Verizon tomorrow and see if they're any help.
 
Old March 11th, 2009, 10:39 AM
Registered User
 
Join Date: Mar 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your input - I have resolved my issue.

I called Verizon and determined that they don't require SSL.

When I changed the code mySmtpClient.EnableSsl = true;
to mySmtpClient.EnableSsl = false;

it worked.


FYI - Verizon customers - settings are as follows:
web.config
Code:
<system.net>
<mailSettings>
<smtpdeliveryMethod="Network"from="me@verizon.net">
<networkhost="outgoing.verizon.net"userName="me"password="mypass" />
</smtp>
</mailSettings>
</system.net>
Email.aspx.cs:
Code:
publicpartialclassDemos_Email : System.Web.UI.Page
{
  protectedvoid Page_Load(object sender, EventArgs e)
  {
    MailMessage myMessage = newMailMessage();
    myMessage.Subject = "Test Message";
    myMessage.Body = "Hello world, from Planet Wrox";
    myMessage.From = newMailAddress("[email protected]");
    myMessage.To.Add(newMailAddress("[email protected]"));
    SmtpClient mySmtpClient = newSmtpClient();
    mySmtpClient.EnableSsl = false;
    mySmtpClient.Send(myMessage);
   }
}



 
Old March 11th, 2009, 04:16 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Great. Glad it's working now....

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!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem sending email with SMTP in VB.Net Compiler Forum and Wrox.com Feedback 3 November 30th, 2007 07:25 PM
SMTP Email Error Handling Ron Howerton Pro Visual Basic 2005 1 July 12th, 2007 08:32 AM
can't deploy on target machine zayasv VS.NET 2002/2003 1 March 25th, 2006 09:31 AM
Sending EMail thru SMTP server in C# - Most of the peri C# 1 December 20th, 2004 09:33 PM
mail() is not sending email on localhost SMTP anshul PHP How-To 5 August 4th, 2004 06:45 AM





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