Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old September 1st, 2008, 03:33 PM
Authorized User
 
Join Date: Mar 2007
Location: , , Denmark.
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
Default

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?

  #12 (permalink)  
Old September 2nd, 2008, 07:10 AM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

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?

  #13 (permalink)  
Old September 2nd, 2008, 10:58 AM
Authorized User
 
Join Date: Mar 2007
Location: , , Denmark.
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
Default

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



  #14 (permalink)  
Old September 2nd, 2008, 11:32 AM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

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.
  #15 (permalink)  
Old September 2nd, 2008, 02:51 PM
Authorized User
 
Join Date: Mar 2007
Location: , , Denmark.
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
Default

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

  #16 (permalink)  
Old September 2nd, 2008, 03:33 PM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Actually, I don't think you even need that "__code" part any more with the 3.5 compiler...

  #17 (permalink)  
Old September 3rd, 2008, 12:27 AM
Authorized User
 
Join Date: Mar 2007
Location: , , Denmark.
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
Default

Ok, I didn't know that. I'll experiment a little with that later.

So much to learn, so little time :D

Thanks...

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 11:15 PM.


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