IIS 7 & IIS 8
Setting up SMTP on IIS 7
Last post Apr 12, 2012 05:46 AM by qbernard
Apr 21, 2009 02:30 PM|LINK
Great, IIS7 is supposed to make my life easier, right? WRONG! I have just spent about 3hr trying to figure out how to setup SMTP virtual server. I have the SMTP running but IIS manager doesnt show the virtual smtp server like in iis6.
no help out there...
I am running win2k8 server and IIS 7.
smtp configuration under IIS 7.0 asp.net mail
Apr 21, 2009 04:03 PM|LINK
Okay, got it running. here's how:
1. start->administrative tools->server manager, go to features, select "add features", tick "smtp server" (if it is not already installed), choose to install the required "remote server admin toos"
2. check to confirm that "Simple Mail Transfer Protocol (SMTP)" service is running, if so, we are good to go.
3. start->administrative tools>internet info services(iis) 6.0
4. make sure that SMTP virtual server/default smtp server is running, if not, right click, then choose "start"
5. in IIS7, go to website/virtual directory, double click "SMTP E-mail", Click on "Deliver e-mail to SMTP server", check the "Use localhost" checkmark
6.Your code should be LIKE:
SmtpClient serv = new SmtpClient();
MailMessage msg = new MailMessage();
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"]);
--->My app is now sending emails. The first email spent about 30 min in the Queue folder, but after that, each email is sent straight away. (this is working for testing purposes, i am not sure if i should use this setup in a production environment - please
smtp iis 7.0 virtual server mailsettings c# 6.0 smtpclient
Apr 21, 2009 04:25 PM|LINK
Jul 10, 2009 12:00 PM|LINK
Mate! Get one thing very clear in your mind right now if you wanna be an IT devloper ...
Nothing microsoft makes your life easy! Especially upgrades.
They encourage you to upgrade at every turn, but trust every time you do something will break, and not just any something, microsoft technologies will break other already established microsoft technologies.
The MS heads would argue, but first answer this ...
1: Who in their right mind would change the packaged mail interface fom CDONTS, to CDO, to NOTHING, with each web server upgrade thus making (how many? Millions of) websites broken. What world has the resources to cope with such epic scale code upgrades?
2: Who in their right mind would encourage a technology upgrade that CHANGES WEBPAGE NAMES from *.asp to *.aspx? Do they get that millions of established websites have spent years making links all over the web to their sites, only to have MS in their wisdom
try their hardest to UNDO ALL OF THEIR HARD WORK?
Mate Ive been a developer for 15 years and if you want my advise, install Apache on your windoze OS and learn how to use it - ONCE ONLY. You can then use some sensible languages and technologies very easily and with portability. You can configure Apache
to leave your pages named *.asp so your web links still work. Apache supports everything you will ever need. Free. IIS is a babies suckie toy next to Apache.
Soon you will also ditch the windoze server OS for a linux server OS and your life will be bliss.
You can all dispute all you like but honestly MS are idiots who have been continually making developers lives hell for their entire history and wont learn. The only reason Im here is because a client of mine requires that I maintain their ASP site, if thats
even a sentence.
Anyway the answer to your mail problem (or rather MS's mail stuffup) is:
mail on vista
smtp on vista
Jul 21, 2009 12:24 PM|LINK
Bravo! mate :)
Sep 16, 2009 02:16 PM|LINK
Vista Home Premium
Sep 23, 2009 04:29 AM|LINK
You need to install a mail server (I use hMailServer which is open source and great) read the doco, understand it, and set it up as per your requirements.
Then, the mail server is completely unrelated to your IIS and runs as a service - usually on ports 25 for SMTP, 110 for POP, and 143 for IMAP. YOU WILL NEED TO SELECT "Start->Control Panel->Allow a program through the firewall" AND MAKE ENTIRES FOR EACH
Then, you will call the mail service as follows, depending on your code language : -
For Classic ASP you will use one of CDONTS or CDO (Google them for examples).
For ASP.NET setup see "Control Panel->System and Maintenance->Administrative Tools->IIS Manager->ASP.NET->SMTP Mail".
Note that if you want webmail thats another app again. Mailbee is OK, free for small volume use, and comes in ASP.NET.
All the best,
Oct 24, 2009 04:30 PM|LINK
3. start->administrative tools>internet info services(iis) 6.0
The guys from microsoft really wanna tell me that they developed a Windows 2008
Webserver Edition which has not the possibility to send out e-mails?
Is there any webapplication around in the world which is not sending out e-mails?
I have to use IIS7 and IIS6 at the same time? Or i have to use another third party application? Holy shit - i can not believe that!!!!!! What about performance and security?
(as far as i remember i just deinstalled all IIS6 settings to ad "FTP Publishing feature(lol)" to a IIS7 Website.) Damn!!
Oct 25, 2009 03:15 AM|LINK
I'm not sure what you are talking about. Vista / Win7 don't have a SMTP server available, IIS has a way to configure for applications to forward messages. That is in IIS manager.
As far as SMTP feature, you have to make sure you allow local host send message by adding the IIS_IUSRS or application pools full access to the c:\inetpub\mailroot\pickup folder. Secondly, your ISP has to allow port 25 access to send email. mail servers
totally rely on DNS for resolution, if something isn't working, enable logging and see what the error is.
Windows Server MVP - IIS
Log archival solution
Install, Configure, Forget
Feb 18, 2010 05:00 AM|LINK
Using the virtual SMTP server in IIS 6 on Server 2008 is not any more precarious than running any other SMTP server, in both cases you will need to make sure that you have the correct security settings in place to avoid being an open relay target. Granted,
the SMTP server built in to Windows Server is a pretty no-frills option, and you could get better secure options in a third party SMTP application (like Secure Authentication for remote callers), but it should work fine for most applications that need SMTP
I have to remark as well about the comment below that suggests all MS patches break existing stuff blah blah...I have been managing Windows Servers for years (since the NT 4 days) and I have run into my share of patching snafus. I have to say that MS had
made incredible strides in increasing patch reliability and documenting what each patch does. Most of the people these days that I see run into problems were either installing patches they didn't need, or did not properly examine their environment to see all
things the patches might touch. That said, managing a production web server can be difficult at times, but you have to be aware of what your apps/services are doing before you start altering the OS with updates. Btw, I have heard it remarked that the Stone
Age didn't end because we ran out of stones, but because we found a better way of doing things, and if you want to use CDONTS you can, as long as you don't have to authenticate or send against a remote SMTP server you should have no problems, the functionality
still exists (you can still write programs in BASIC as well but wth would you want to?).