Thread: Smtp
View Single Post
  #6 (permalink)  
Old November 1st, 2008, 03:46 PM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

If this is related to the book ASP.NET 2.0 - Instant Results, you would have been better off posting this in the book's own forum: http://p2p.wrox.com/forum.asp?FORUM_ID=249

Anyway, you probably need to talk to your network administrator to get the right information like the SMTP server name. Maybe they don't allow you to use their SMTP server remotely, maybe you need to pass in credentials before you are allowed to use them; maybe the server is only accessible from within a specific network (range). We can't answer these kind of questions for you; only the system administrator will be able to answer them for you.

In web.config you need to define the mail server, not the address. So, anything with an @ in it will fail. The config element looks like this:
Code:
<system.net>
<mailSettings>
  <smtp>
    <network host="YourHost"/>
  </smtp>
</mailSettings>
</system.net>
If you need to pass a user name and password, try this:
Code:
<system.net>
<mailSettings>
  <smtp>
    <network host="YourHost" userName="UserName" password="Password"/>
  </smtp>
</mailSettings>
</system.net>
Hope this helps,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote