I had a similar problem. Since I stumbled during my research over this question, here is what I ended up with:
For unit testing you can use subethasmtp. Base on subethasmtp I also wrote a program that you can use to call from scripts an query the results: developmentSMTP
发布评论
评论(3)
python 有一个很好的技巧: http: //muffinresearch.co.uk/archives/2010/10/15/fake-smtp-server-with-python/
只需一个班轮即可完成这项工作(侦听端口
2500
) :there is a nice trick with python: http://muffinresearch.co.uk/archives/2010/10/15/fake-smtp-server-with-python/
Just one liner can do the job (listens on port
2500
):免责声明 - 我在下面链接的该服务背后的公司工作。
您还可以使用托管电子邮件测试服务,例如 Mailosaur。其中一些(包括我们的)附带一个 API,用于集成到您的测试中。
这样,如果您遇到问题,您可以让其他人为您完成添加新功能等方面的艰苦工作。
Disclaimer - I work for the company behind this service linked to below.
You can also use a hosted email testing service like Mailosaur. Some of them (ours included) come with an API for integrating into your tests.
That way if you hit a problem you've got someone else to do the hard work in adding new features, etc. for you.
我有类似的问题。由于我在研究这个问题时偶然发现了这个问题,所以我最终得到了以下结果:
对于单元测试,您可以使用 subethasmtp。基于 subethasmtp 我还编写了一个程序,您可以使用它从脚本调用查询结果: developmentSMTP
I had a similar problem. Since I stumbled during my research over this question, here is what I ended up with:
For unit testing you can use subethasmtp. Base on subethasmtp I also wrote a program that you can use to call from scripts an query the results: developmentSMTP