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

September 17th, 2009, 09:56 AM
|
|
Registered User
|
|
Join Date: Sep 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
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());
}
|

September 17th, 2009, 10:43 AM
|
 |
Wrox Author
|
|
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 892
Thanks: 12
Thanked 154 Times in 153 Posts
|
|
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/
|

September 17th, 2009, 01:13 PM
|
|
Registered User
|
|
Join Date: Sep 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
What is SMTP E-mail feature is ASp.net pane of iis manager? i thought that it could be used as SMTP server.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |