p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 (http://p2p.wrox.com/forumdisplay.php?f=264)
-   -   Question Re Sending mail in Chapter 3 (http://p2p.wrox.com/showthread.php?t=52274)

_fluffy_ January 4th, 2007 07:26 PM

Question Re Sending mail in Chapter 3
 
Hello !

i'm trying to send mail using the Contact.aspx form in Chaper 3.
However, i get the message that there was a problem sending my
mail, and when I print out the Exception message it turns out to be:
"System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: The remote name could not be resolved: '(localhost)'"

So my question is, is the setting in system.net section supposed to be
<network defaultCredentials="true" host="(localhost)" port="25"/>

or should I actually replace the string "(localhost)" with
something more specific ?

i'm not very knowledgable in networking, so i'm not sure how this
whole mail sending process works...should my computer have any
specific settings, like some open ports or something..??? [:I]

thanks alot for any tips...

--fluffy


vantoko January 5th, 2007 04:48 PM

your computer should have an smtp provider that allows you to send mails

check this page : http://www.microsoft.com/technet/pro....mspx?mfr=true

koen


papalolo22 January 7th, 2007 10:28 AM

Did you include the smtp deliveryMethod?


englere January 7th, 2007 11:47 AM

The SMTP service isn't used by ASP.NET to deliver email. It uses CDOSYS which is included with Windows. It normally figures out how to locate the proper SMTP server to handle your outgoing mail (it can locate MS Exchange automatically, but I'm not sure about other SMTP servers). You can always hard-code the specific name of the SMTP server handling your web server.

In your case it looks like you gave it the name of your local SQL Server (which likes parens). The name of your web server does not have parens. If you change it to "localhost" you should be happy.

Some SMTP servers want you to authenticate with them (but most do not since they only accept outgoing mail from their local network, which includes your web server):
http://www.codeproject.com/dotnet/Sy..._SMTP_AUTH.asp

Eric


_fluffy_ January 8th, 2007 05:53 PM

Okay, thanks a lot...Now I get it- I didn't have an smtp server installed ![8D]


englere January 9th, 2007 12:30 AM

You don't need the SMTP server if you have an exchange server accessable by your web server. You just need to fix the hostname. Use "localhost", and not "(localhost)".

Eric



All times are GMT -4. The time now is 06:20 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.