日期:2009-07-06  浏览次数:20553 次

This article covers one of the most common questions I see about getting email sent properly from an ASP or ASP.NET page.   How do to setup my pc machine or server to send CDONTS mail.  Step 4 is generally what have to be setup. This article covers having a mail program and SMTP service on the same server.   It already assumes you have a SMTP server running on your network in either case.

We were working on an app that sends email using CDONTS from our development web server.  We also run mail server on the same server that provides POP3, SMTP, IMAP services.  The issue was getting both the mail programs SMTP service and the Windows 2000 SMTP service that is provided as part of IIS.   The problem is one service wouldn't start up due to both were trying to use the default SMTP port 25.  There is a work around I discovered recently that allowed both to operate.  There is one issue with this setup, The Windows 2000 SMTP service won't be able to receive mail.  

For those developers who are at home, using a dial-up or broadband service.  I've found some ISP's that allow you to put their settings in the Internet Svc Manager(PS: I can't guarentee this will work but its worth a shot!, if your ISP comes after you, I claim no responsibility).  If your unsure what is being mentioned, verify the pop3 and smtp settings in your Mail program such as Outlook, Outlook Express or whatever you use and place the same SMTP settings in IIS.

Install Mail Server Program (IMail, Mercury Mail etc..)
Configure mail program(Imail, Mercury Mail etc.) to route SMTP traffic.  
Open Internet Service Manager, Right click on SMTP Default Virtual Server, click advanced on general tab and edit the port to 26.  ONLY EDIT THE PORT IF YOU HAVE TWO SMTP SERVICES RUNNING ON THE SAME SERVER, OTHERWISE LEAVE PORT 25! 0



'If your just trying to configure the Windows SMTP service provided by IIS , Open Internet Svc manager, right click on SMTP Default Virtual Server and follow step 4,
While in the SMTP properties tab, click the Delivery Tab, select the Advanced fill in the smart host information.  The Fully-Qualified Domain Name textbox needs the computername entered.  My experience this needs to be able to resolve in DNS


Start SMTP in services control panel. (Start, Settings, Control panel, Admin tools, Services Icon)
Stop and start Mail Program SMTP service.
Create an ASP page or ASP.net page to test out or download our examples

sample dwonload
原文