SMTP server that saves all mail to a folder? [clos

2019-01-31 13:48发布

Are there any free SMTP servers that just accept the mail sent through them, and save it to your hard disk, without sending it to the recipient. I would like to use this for testing my applications. Instead of just waiting around for the mail to go through, it would be nice if all emails could just be dropped in a folder, so that I can look at them. I could put some hooks into my program to just save instead of sending the message, but I don't think it's a full test, if the code follows a different path. Are there any existing applications like this?

I figure this would be really helpful, because you could test the mail abilities without needing to wait for the mail server to deliver it, and so that you can code while you're offline, and don't have access to an actual mail server.

[EDIT]

I'm specifically using .Net, but I'm not using the default SMTP mail handling classes in .Net, because of how limited they were in .Net 1.1. We are using a third party library (chilkat). I know that things have changed since then, but the code is stable and works, so no point in rewriting against the .Net API now.

I would like something that works as an SMTP server specifically because I could use it in the future for whatever projects I worked on, no matter the language.

标签: testing smtp
8条回答
Rolldiameter
2楼-- · 2019-01-31 13:56

There is the python DebuggingServer as well part of the standard library :

http://docs.python.org/library/smtpd.html#debuggingserver-objects

it will print everything on stdout.

查看更多
Animai°情兽
4楼-- · 2019-01-31 14:03

bit late on this one, but have you tried ssfd?

you can put it on your machine or on a network server, catches e-mails and pops them in a directory

查看更多
Ridiculous、
5楼-- · 2019-01-31 14:04

It's fairly easy to do in sendmail or postfix - just configure the local delivery agent to be 'cat >> file'.

查看更多
何必那么认真
6楼-- · 2019-01-31 14:05

I am years late to the party but this works great for me.

http://emailrelay.sourceforge.net/

Having the .net email client just save the email and not send it does not answer the question if your code works. To tell if it works you must actually send it.

查看更多
虎瘦雄心在
7楼-- · 2019-01-31 14:09

You can use the standard smtp settings in your app or web.config and just specify what folder you want the emails to go.

<smtp
  deliveryMethod="specifiedPickupDirectory" 
  from="from address">
  <specifiedPickupDirectory>Your folder here</specifiedPickupDirectory>
</smtp>

This allows you to simply store the emails without an smtp server

查看更多
登录 后发表回答