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 20th, 2009, 02:17 PM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 194
Thanks: 5
Thanked 3 Times in 3 Posts
Default smpt client not being resolved.

I have been working through your book and I am currently having trouble getting the page to send me an email when it loads. (page 310 Chap 4).

I have an email address set up with my domain and I can send and receive emails with it so I know that it is configured correctly and works however when I reference the smpt client it is generating errors I believe.

The error is:
"The remote name could not be resolved: 'smtp.parkerdsgn.com'"

And the stack trace is:

Code:
[WebException: The remote name could not be resolved: 'smtp.parkerdsgn.com']
   System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) +5421675
   System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +202
   System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21
   System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +332
   System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +160
   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\Demos\Email.aspx.vb:14
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
But my smtp server is smtp.parkerdsgn.com so I am not sure whats wrong?

The code I have in my vb file is:

Code:
   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 Will"
        myMessage.From = New MailAddress("[email protected]", "xxxxxx")
        myMessage.To.Add(New MailAddress("[email protected]", "xxxx"))

        Dim mySmtpClient = New SmtpClient()
        mySmtpClient.Send(myMessage)
Any help would be good, cheers.
 
Old February 21st, 2009, 06:16 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I have an email address set up with my domain and I can send and receive emails with it so I know that it is configured correctly
Are you sure you're using the smtp server you mentioned below and not the one from your ISP? The fact that you have a domain and an associaetd e-mail address doesn't mean you also have an SMTP server. I tried resolving this address and didn't get back an IP address either./

Look into your mail client and see what SMTP server it uses. It may very well be different from what you posted here.

Hope this helps,

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 21st, 2009, 06:34 AM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 194
Thanks: 5
Thanked 3 Times in 3 Posts
Default

I checked my settings I have configured in Mozilla thunderbird and it says my outgoing server (SMTP) is mail.parkerdsgn.com and the server name is my servers ip address.
 
Old February 21st, 2009, 06:37 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

'smtp.parkerdsgn.com' != 'mail.parkerdsgn.com'

Maybe you're just using the wrong server name?

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 21st, 2009, 06:48 AM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 194
Thanks: 5
Thanked 3 Times in 3 Posts
Default

Thanks that worked.

I thought I had to have smtp infront of the server name so I was just replacing mail with smtp. I see now that I don't have to do that.

Thanks again for your help.
 
Old February 21st, 2009, 07:27 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're welcome.

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!





Similar Threads
Thread Thread Starter Forum Replies Last Post
[Resolved] String - right justify value snufse ASP.NET 2.0 Basics 3 November 14th, 2008 12:29 PM
"The remote name could not be resolved" teddyk ASP.NET 2.0 Basics 0 October 28th, 2008 12:49 AM
connecting client to client (Socket programming) maricar C# 0 September 25th, 2008 04:34 AM
Sinks with SMPT server aking Internet Information Services 0 April 27th, 2007 04:45 AM





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