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, 2009, 09:55 AM
Registered User
 
Join Date: Feb 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating E-Mail Messages

I have seen others posting very similar questions and I apologize if I am simply rehashing an old problem, but I have not been able to find an answer to my problem yet.

I receive an error each time I attempt to open the Demos/Email.aspx page in the browser.

I do know that my mail server does allow me to send e-mails in this manner, as I have very similar setups on other sites (I'm actually taking on ASP.NET 3.5 to add to the repertoire), so I know the server is not the issue.

Following is the error:
Quote:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xx.xxx.xx.xx:xx

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xx.xxx.xx.xx:xx

Source Error:

Line 12: Dim mySmtpClient As SmtpClient = New SmtpClient()
Line 13: mySmtpClient.EnableSsl = True
Line 14: mySmtpClient.Send(myMessage)
Line 15: End Sub
Line 16: End Class
Source File: C:\BegASPNET\Site\Demos\Email.aspx.vb Line: 14
Following is web.config:

Code:
<system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from="xxxxx &lt;[email protected]&gt;">
        <network host="mail.xxxxxxxxxx.xxx" userName="[email protected]" password ="xxxxxxxxxx" />
      </smtp>
    </mailSettings>
  </system.net>
Following is Demos/Email.aspx.vb:

Code:
Imports System.Net.Mail
Partial Class Email
    Inherits BasePage

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim myMessage As MailMessage = New MailMessage()
        myMessage.Subject = "Test Message"
        myMessage.Body = "Hello world, from Planet Wrox"
        myMessage.From = New MailAddress("[email protected]", "xxxxx")
        myMessage.To.Add(New MailAddress("[email protected]", "xxxxx"))

        Dim mySmtpClient As SmtpClient = New SmtpClient()
        mySmtpClient.EnableSsl = True
        mySmtpClient.Send(myMessage)
    End Sub
End Class
I am hoping that I have a small typo that I am overlooking, but any help would be appreciated.
 
Old February 17th, 2009, 11:07 AM
Registered User
 
Join Date: Feb 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Finally figured it out and it was on my end. There were settings that were initially set for PHP on the e-mail server that would not allow the ASP to process the e-mail "form".

Fixed and ready to go.

Sorry to waste your time reading over this if you already did so.





Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 9:Creating Email messages pg310 the3musketeer BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 January 21st, 2009 03:29 AM
Creating E-Mail Messages janla2112 ASP.NET 3.5 Basics 3 October 26th, 2008 01:23 PM
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
Send messages to users not using e-mail Clayton_Couto General .NET 0 July 19th, 2006 07:23 AM
Sending both text mail and HTML mail - CDONTS madhukp Classic ASP Basics 1 October 8th, 2003 01:05 AM





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