如何创建电子邮件发送服务? [英] How do I create an email-sending service?

查看:113
本文介绍了如何创建电子邮件发送服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在琢磨这个想法一段时间,并想阅读你的想法。



我想创建一个.NET服务发送和跟踪电子邮件。



我的粗略想法:


  1. 应用程序,串行化.NET电子邮件(System.Net.Mail.MailMessage)对象的实例,并将其放入数据库或文件系统队列中


  2. 邮件服务/进程轮询队列并发送电子邮件


  3. 强制订阅/取消订阅列表/规则



  4. 将状态回报到原始应用程序

  5. 有没有人有什么建议,我应该如何开始,或者我可能有什么问题?是否有现成的软件/服务我应该看看?

    解决方案

    您将需要了解关于SMTP协议,即使您正在使用更高级别的工具,为您做大部分工作。在我自己处理使用.NET的出站和入站电子邮件的经验中,我没有真正得到它,直到我学会远程登录到SMTP服务器的端口25,并通过自己发出命令发送电子邮件。



    如果您发送大量电子邮件,并且需要监视NDR(不可交付报告),则必须将SMTP信封发件人地址设置为您自己的服务器,并解析所有这些电子邮件当他们进来了解发生了什么。



    System.Net电子邮件类别不允许您在与MTA的会话中设置MAIL FROM,而不需要将电子邮件标题中的发件人地址设置为同一件事,因此您将需要使用第三方库,例如 aspNetEmail 如果您需要这些地址不同。



    ListNanny 是另一个有助于解析NDR的工具,其他功能ns。



    我不知道如何序列化MailMessage对象。我认为只要存储单独的数据元素就会更简单,然后在需要时实例化MailMessage对象。


    I've been kicking around this idea for a while and would like to read your thoughts.

    I'd like to create a .NET service to send and track email messages.

    My rough ideas:

    1. Within various applications, serialize instances of .NET email (System.Net.Mail.MailMessage) objects and put them into a database or file system queue

    2. The mail service/process polls the queue and sends the emails

    3. Enforce subscribe/unsubscribe lists/rules

    4. Track opens, bounces, out-of-office auto-replies, etc.

    5. Report statuses back to the original applications

    Does anyone have advice for how I should get started or what issues I may have? Is there off-the-shelf software/service I should look at?

    解决方案

    You will need to learn everything you can about the SMTP protocol, even if you are using higher level tools that do most of the work for you. In my own experience with processing outbound and inbound emails with .NET, I didn't really "get it" until I learned to telnet to port 25 of an SMTP server and send en email by issuing the commands myself.

    If you are sending lots of emails out and you need to monitor NDRs (non-deliverable reports), you will have to set the SMTP envelope sender address to your own server and parse all of those emails when they come in to figure out what happened.

    The System.Net email classes don't allow you to set the MAIL FROM in the conversation with the MTA without also setting the From address in the email header to the same thing, so you will need to use a 3rd party library like aspNetEmail if you need those addresses to be different.

    ListNanny is another tool that is helpful to parse NDRs, among other functions.

    I'm not sure about serializing the MailMessage objects. I think it would be simpler to just store the separate data elements themselves and then instantiate MailMessage objects when you need them.

    这篇关于如何创建电子邮件发送服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆