 |
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
|
|
|
|

September 1st, 2008, 03:33 PM
|
Authorized User
|
|
Join Date: Mar 2007
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
Ok, I give up... I need help with sending email via the Contact form developed in ch. 3.
Hope it's ok that I resurrect this old topic.
During my last attempt at theBeerHouse (.NET 2.0) it worked fine.
Now I picked up the project again, this time using .NET 3.5, the code is exactly the same, but it doesn't work.
I don't receive any errormessages, the mail just doesn't get sent. The exception catches it. Unfortunately, I'm no debugging hero
Since the last time I worked on this project, I re-installed win XP. I installed IIS after the .NET framework, which meant that IIS didn't work.
I ran a repair on the framework in "add remove programs", and it worked fine again.
But I can't send any email, and I just can't figure out why. SMTP is installed, the settings for the virtual smtp client in IIS is set up (relay etc.),
and I have tried different setting for this with no luck.
My web config code for mail is as follows:
<system.net>
<mailSettings>
<smtp deliveryMethod="PickupDirectoryFromIis" from="foo@bar.dk">
<network defaultCredentials="true" host="(localhost)" port="25"/>
</smtp>
</mailSettings>
</system.net>
The code in Contact.aspx.cs is exactly as in the book...
Anyone else with these issues?
|

September 2nd, 2008, 07:10 AM
|
 |
Wrox Author
|
|
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
|
|
Quote:
quote:Originally posted by philthy
I don't receive any errormessages, the mail just doesn't get sent. The exception catches it. Unfortunately, I'm no debugging hero
|
What is the exception that is being caught?
|

September 2nd, 2008, 10:58 AM
|
Authorized User
|
|
Join Date: Mar 2007
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
Quote:
quote:Originally posted by Lee Dumond
Quote:
quote:Originally posted by philthy
|
Quote:
I don't receive any errormessages, the mail just doesn't get sent. The exception catches it. Unfortunately, I'm no debugging hero
|
What is the exception that is being caught?
|
All the code in my Contact.aspx.cs is identical to the code in the book, I didn't make any changes to it.
catch (Exception)
{
lblFeedbackOK.Visible = false;
lblFeedbackBad.Visible = true;
}
|

September 2nd, 2008, 11:32 AM
|
 |
Wrox Author
|
|
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
|
|
So, you are getting the FeedbackBad message then?
What I would do is change this to something that will help us debug this easier:
catch (Exception ex)
{
lblFeedbackOK.Visible = false;
lblFeedbackBad.Visible = true;
lblFeedbackBad.Text = ex.Message;
}
Even better, place a breakpoint somewhere in this catch block, and examine the ex you are getting.
Basically, you need to find out exactly what the exception is before you can solve the issue.
IF, on the other hand, you are getting the FeedbackOK message, then we can be assured that your code is good. Let us know if that is the case, then we can try something else.
|

September 2nd, 2008, 02:51 PM
|
Authorized User
|
|
Join Date: Mar 2007
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
Hey Lee, thanks for kicking me in the right direction...
I started playing around with the debugger, and set some breakpoints as you suggested. Then I started getting some interesting errormessages.
There was an error with type initializing in the Globals class, and an error in web config: "not able to load type MB.TheBeerHouse.TheBeerHouseSection, __code"
First I thought I had made a mess with my namespaces, but then I noticed that I missed the comma right before "__code" in web config where you register the configsection class.
One comma, and the whole thing goes down the toilet...:D
I need to use the debugger more, it's quite an effective tool...
Thanks for your help :)
|

September 2nd, 2008, 03:33 PM
|
 |
Wrox Author
|
|
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
|
|
Actually, I don't think you even need that "__code" part any more with the 3.5 compiler...
|

September 3rd, 2008, 12:27 AM
|
Authorized User
|
|
Join Date: Mar 2007
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
Ok, I didn't know that. I'll experiment a little with that later.
So much to learn, so little time :D
Thanks...
|
Similar Threads
|
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
Sending email |
ironchef |
Pro JSP |
3 |
February 17th, 2008 11:38 PM |
Sending email |
maitias |
C# 2005 |
2 |
February 17th, 2006 11:24 AM |
sending email |
keyvanjan |
Classic ASP Components |
1 |
May 9th, 2005 05:56 PM |
email sending |
msrnivas |
.NET Web Services |
6 |
June 26th, 2004 06:59 AM |
|
 |