Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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 January 4th, 2007, 07:26 PM
Authorized User
 
Join Date: Oct 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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..???

thanks alot for any tips...

--fluffy

 
Old January 5th, 2007, 04:48 PM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 142
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to vantoko
Default

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

 
Old January 7th, 2007, 10:28 AM
Authorized User
 
Join Date: Oct 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you include the smtp deliveryMethod?

 
Old January 7th, 2007, 11:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old January 8th, 2007, 05:53 PM
Authorized User
 
Join Date: Oct 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old January 9th, 2007, 12:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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






Similar Threads
Thread Thread Starter Forum Replies Last Post
problems sending mail with java mail gandacuboy J2EE 2 December 20th, 2006 03:05 PM
sending mail hastikeyvan ASP.NET 2.0 Basics 0 June 10th, 2006 08:17 AM
sending mail ashokparchuri General .NET 3 May 5th, 2005 02:42 AM
Sending e-mail to different mail box! Calibus Classic ASP Databases 4 September 3rd, 2004 05:48 PM
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.