p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
I forgot my password
Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of computer programmers 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 programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 17th, 2009, 09:56 AM
Registered User
Points: 13, Level: 1
Points: 13, Level: 1 Points: 13, Level: 1 Points: 13, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default failure sending e-mail (os is windows 7 and server is iis7)

the following code works well in windows xp os but in windows 7 doesn't
i have tried different ports (587,465, 25) but nevetheless it does not work. I think than problem with some configurations either in iis7 or asp.net or os etc.
please help
string host = "smtp.mail.ru";
string to = "destinationemaladd@mail.ru";
string from = "myemail@domain.ru";// от кого идет письмо
string subject ="Testing";
string body = "Testing email opportunity";
string user = "somename";// имя пользователя
string pass = "password";
MailMessage message = new MailMessage(from, to, subject, body);
SmtpClient smtpClient = new SmtpClient(host, 25);
smtpClient.Credentials = new NetworkCredential(user, pass);
smtpClient.EnableSsl = true;
try
{
smtpClient.Send(message);
MessageBox.Show("Your message is delivered");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old September 17th, 2009, 10:43 AM
Lee Dumond's Avatar
Wrox Author
Points: 4,694, Level: 28
Points: 4,694, Level: 28 Points: 4,694, Level: 28 Points: 4,694, Level: 28
Activity: 70%
Activity: 70% Activity: 70% Activity: 70%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 892
Thanks: 12
Thanked 154 Times in 153 Posts
Default

Were you using a local SMTP server on XP? If so, that may be the issue, because Win7/IIS7 doesn't include a SMTP server.

You could install a SMTP server, or even better, install a SMTP development server just for testing purposes, like Antix.

http://leedumond.com/blog/a-better-s...opment-server/
__________________
Author of the upcoming ASP.NET 4.0 Website Programming: Problem - Design - Solution

Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old September 17th, 2009, 01:13 PM
Registered User
Points: 13, Level: 1
Points: 13, Level: 1 Points: 13, Level: 1 Points: 13, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

What is SMTP E-mail feature is ASp.net pane of iis manager? i thought that it could be used as SMTP server.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Failure sending mail. phuc2583 ASP.NET 3.5 Professionals 6 September 8th, 2009 08:34 PM
sending mail from sql server pady123 SQL Server 2005 0 October 17th, 2008 01:58 AM
Sending E-Mail from Local to Remote Server tact_259 Classic ASP Basics 6 April 13th, 2008 01:46 AM
IIS7, Front Page Server Extentions, Vista Bob Bedell ASP.NET 2.0 Professional 10 September 20th, 2007 12:21 PM
Failure sending email shoakat ASP.NET 2.0 Professional 1 July 4th, 2007 09:05 PM



All times are GMT -4. The time now is 01:00 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 2010 Wiley Publishing, Inc