简体   繁体   中英

Configure IIS to receive email

According to this answer it is possible to configure IIS to receive email. That is what I would like to do. But the answer says it's done under IIS SMTP under domains .

I connected to my website (on a web host) using IIS Manager and the only SMTP option I see is SMTP E-mail under the ASP.NET heading. (I have one more heading which is IIS , but doesn't have any SMTP under it.)

Clicking on SMTP E-mail shows me an option to "Use this feature...when sending e-mail...". and it has a textbox for E-mail address and radio buttons to choose from Deliver e-mail to SMTP server and Store e-mail in pickup directory .

I don't see any option for allowing it to receive emails.

So where is the option to receive emails?

(If you have a different way to receive emails without any action taken on them, I'd be glad to hear about it. I want to process the email regardless of the address it's being sent to as long as it's to my domain.)

You need the IIS 6 manager for that - even if you have IIS 7-8-9-10 installed. The SMTP part is still only in IIS 6 :(

It's not problem to run them side-by-side and you will use IIS 6 manager only for SMTP

With this option you could send and receive emails.

The IIS 6 manager looks like this:

在此输入图像描述

And with you Windows system you need to install the SMTP server:

在此输入图像描述

which give you IIS 6 (SMTP only)

在此输入图像描述

See also https://www.interserver.net/tips/kb/how-to-setup-and-configure-smtp-server-on-windows-server-2008-r2/

And http://www.vsysad.com/2017/05/install-and-configure-smtp-server-on-windows-server-2016/

and see also How to configure SMTP in IIS 7?

I have a scenario where I wanted my web application to accept inbound emails and process them. I didn't find the SMTP server that comes with IIS to be helpful.

What ended up being a much better solution for receiving mail messages for me was to use an inbound email parsing service. You configure a domain's MX record to point to their (parsing service provider) mail server and their mail server parses the message and Posts to a page on your web server. My ASP.Net MVC Controller Action looks like this:

public ActionResult InboundMessage(FormCollection collection, HttpPostedFileBase attachment1, string attachments, string to, string from)

They get the email and call my code. I don't have to worry about any of the SMTP details. I've been using this for several years and it's worked great for me.

I'm not sure how recommending a specific product goes over around here, but if you Google "inbound email parser", you'll find several options.

If you want to go the original route, it is possible to receive inbound mail. It will write incoming messages to the "Drop" folder. (If you Google "IIS SMTP Drop folder", you will find information about how to do this.)

Before I found the Inbound Parse service, I ended up cobbling my own mail server together from some code on found on GitHub, but even then, parsing the parts of a message was a much bigger undertaking than I was expecting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM