Don't worry about people who rant about using this or that. Personally when people rant, and I do rant too, then be prepared to know other technologies. The last I knew, ZERO technology solutions were perfect. :))
I'm running through a asp.net 2.0 install and trying to get the password reset feature working on IIS7 on win2008 x64 box. I've done this many times on win2003 iis6 with the same asp.net application and a lot seems to have changed in IIS7 to get this working.
Installing SMTP feature in IIS7 was my first discovery. Needing the SMTP service running in IIS6 was a second surprise. I've done both but I have not been able to get the app to send the emails for password resets. the last error I got was "Unable to read
data from the transport connection: net_io_connectionclosed" but I got others along the way. In reviewing the above posts, ignoring the tempting pitch for a new career on apache, I see one step I might have missed and that's the "assignment of privs" on the
"drop directory".
What privs need to be set on the drop directory?
Second, is there a step by step how to on how to have an IIS7 environment setup so that ASP.NET applications can send email?
Considering the membership API's authentication mechanism is highly dependent on emailing reset password strings (unless you tweak the web.config), I would imagine its a common task right after you create the virtual directory/application in IIS.
Obviously I have to have this procedure dialed and nailed if its going to be deployed at a customer site.
Edit: I do have this all working now, but my mail settings in web.config are pointing to my external smtp server outside the lan with a live mail user/password in the config file. At customer deployments, ideally, I'd prefer to be able to specify localhost
(and "" for user/password) like I did in the IIS6 days rather than ask a customer to enter their smtp server and maintain a dummy user and password in the web.config).
i found that as well and it did nothing for me. doesn't explain the "To configure SMTP e-mail to deliver e-mail messages immediately, use the following syntax:"
C:\%windir%\system32\inetsrv\appcmd set config /commit:WEBROOT /section:smtp /from:
string /deliveryMethod:network /network.port: int /network.defaultCredentials:True|False /network.host:string /network.userName:string
/network.password:string
I'm not a PHP guy, so if you are going to use the IIS SMTP, then try this simple test. http://support.microsoft.com/?id=297700
it applies to any IIS SMTP, so try that and see if the mail get send out or stuck in queue or badmail folder.
if it is not being sent, then smtp is not working - check event log and smtp log, it could be outgoing 25 port block, target server reject your mail etc
Now, per your php.ini you are using comcast smtp. So if the script doesn't send, then can you manually telnet the the host port 25, then perform manual steps to email, starting with HELO. only you make sure that there is no connection issue, you can manually
sent via telnet then go back to your script to debug.
steve schofi...
5681 Posts
MVP
Moderator
Re: Setting up SMTP on IIS 7
May 07, 2010 11:35 PM|LINK
Don't worry about people who rant about using this or that. Personally when people rant, and I do rant too, then be prepared to know other technologies. The last I knew, ZERO technology solutions were perfect. :))
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
jeffreymergl...
2 Posts
Re: Setting up SMTP on IIS 7
May 12, 2010 04:27 PM|LINK
I'm running through a asp.net 2.0 install and trying to get the password reset feature working on IIS7 on win2008 x64 box. I've done this many times on win2003 iis6 with the same asp.net application and a lot seems to have changed in IIS7 to get this working.
Installing SMTP feature in IIS7 was my first discovery. Needing the SMTP service running in IIS6 was a second surprise. I've done both but I have not been able to get the app to send the emails for password resets. the last error I got was "Unable to read data from the transport connection: net_io_connectionclosed" but I got others along the way. In reviewing the above posts, ignoring the tempting pitch for a new career on apache, I see one step I might have missed and that's the "assignment of privs" on the "drop directory".
What privs need to be set on the drop directory?
Second, is there a step by step how to on how to have an IIS7 environment setup so that ASP.NET applications can send email?
Considering the membership API's authentication mechanism is highly dependent on emailing reset password strings (unless you tweak the web.config), I would imagine its a common task right after you create the virtual directory/application in IIS.
Obviously I have to have this procedure dialed and nailed if its going to be deployed at a customer site.
Edit: I do have this all working now, but my mail settings in web.config are pointing to my external smtp server outside the lan with a live mail user/password in the config file. At customer deployments, ideally, I'd prefer to be able to specify localhost (and "" for user/password) like I did in the IIS6 days rather than ask a customer to enter their smtp server and maintain a dummy user and password in the web.config).
naveenrahul
2 Posts
Re: Setting up SMTP on IIS 7 in php
Oct 06, 2010 09:28 AM|LINK
qbernard
5016 Posts
MVP
Moderator
Re: Setting up SMTP on IIS 7 in php
Oct 12, 2010 01:01 AM|LINK
Bernard Cheah
blkhk1up
10 Posts
Re: Setting up SMTP on IIS 7
Jan 25, 2011 12:05 PM|LINK
this is where you lose me
how did you see this, Find this,
in the feedback.php file?
this is where i derail
6.Your code should be LIKE:
SmtpClient serv = new SmtpClient();
MailMessage msg = new MailMessage();
msg.To.Add("toadrr@domain.com);
msg.Body = "body";
msg.Subject = "subj";
msg.BodyEncoding = System.Text.Encoding.ASCII;
msg.IsBodyHtml = isHTML;
serv.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
serv.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["SmtpServerUserName"], ConfigurationManager.AppSettings["SmtpServerPassword"]);
serv.Send(msg);
blkhk1up
10 Posts
Re: Setting up SMTP on IIS 7
Jan 25, 2011 12:13 PM|LINK
and they said this was not that hard
i have server 2008 w/ IIS7
i have a website up and running without any issues
i have PHP working as it's tested with simple counters and apps like that
i have a smtp installed.
Comcast is my ISP, i have there SMTP and port for Comcast
i have edited the PHP.ini
however I can't figure out the following as well.
can you lay out an example for me
Deliver e-mail messages immediately
To configure SMTP e-mail to deliver e-mail messages immediately, use the following syntax:
C:\%windir%\system32\inetsrv\appcmd set config /commit:WEBROOT /section:smtp /from: string /deliveryMethod:network /network.port: int /network.defaultCredentials:True|False /network.host:string /network.userName:string /network.password:string
blkhk1up
10 Posts
Re: Setting up SMTP on IIS 7 in php
Jan 25, 2011 12:16 PM|LINK
i found that as well and it did nothing for me. doesn't explain the "To configure SMTP e-mail to deliver e-mail messages immediately, use the following syntax:"
C:\%windir%\system32\inetsrv\appcmd set config /commit:WEBROOT /section:smtp /from: string /deliveryMethod:network /network.port: int /network.defaultCredentials:True|False /network.host:string /network.userName:string /network.password:string
blkhk1up
10 Posts
Re: Setting up SMTP on IIS 7
Jan 26, 2011 12:54 PM|LINK
this didn't help at all. i have server 2008 with IIS7. i setup the PHP.ini
[mail function]
; For Win32 only.
sendmail_from = me@comcast.net
SMTP = smtp.comcast.net
smtp_port = 587
<div>the test_mail.php looks like this<?php
$to = "someone@comcast.net";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = me@comcast.net;
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?></div> <div> </div> <div>still nothing. </div> <div>need SMTP for dummies on IIS7 </div>
qbernard
5016 Posts
MVP
Moderator
Re: Setting up SMTP on IIS 7
Jan 27, 2011 02:09 AM|LINK
I'm not a PHP guy, so if you are going to use the IIS SMTP, then try this simple test.
http://support.microsoft.com/?id=297700
it applies to any IIS SMTP, so try that and see if the mail get send out or stuck in queue or badmail folder.
if it is not being sent, then smtp is not working - check event log and smtp log, it could be outgoing 25 port block, target server reject your mail etc
Now, per your php.ini you are using comcast smtp. So if the script doesn't send, then can you manually telnet the the host port 25, then perform manual steps to email, starting with HELO. only you make sure that there is no connection issue, you can manually sent via telnet then go back to your script to debug.
Bernard Cheah
blkhk1up
10 Posts
Re: Setting up SMTP on IIS 7
Jan 27, 2011 05:36 PM|LINK
6.Your code should be LIKE: ???????????
this is where you lose me...
where is this code? what is this code for and from.