为 windows 开发 smtp 服务器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1353439/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
development smtp server for windows
提问by Tolga
I am looking for a free test smptp server which can save emails in to filesfor my development tests. Since my development environment is windows I prefer test email server to run on windows but I can consider to install any other linux based alternatives.
我正在寻找一个免费的测试 smptp 服务器,它可以将电子邮件保存到我的开发测试文件中。由于我的开发环境是 windows,我更喜欢在 windows 上运行测试电子邮件服务器,但我可以考虑安装任何其他基于 linux 的替代方案。
采纳答案by marc_s
There are a few:
有几个:
- SMTP Impostor(formerly Antix SMTP Server), NuGet package- looks very good
- Dumbster- fake SMTP server under Apache license
- SMTP Impostor(原 Antix SMTP Server),NuGet 包- 看起来很不错
- Dumbster- Apache 许可下的假 SMTP 服务器
Or you can also set it up in your web.configto just store the e-mails in the file system (the config way of what "silky" has proposed in code):
或者您也可以在您的web.config中将其设置为仅将电子邮件存储在文件系统中(“silky”在代码中提出的配置方式):
<system.net>
<mailSettings>
<smtp deliveryMethod="SpecifiedPickupDirectory">
<specifiedPickupDirectory
pickupDirectoryLocation="c:\temp\mails\"/>
</smtp>
</mailSettings>
</system.net>
Marc
马克
回答by Jonathan Stanton
I know that this is an old post however I also know about http://smtp4dev.codeplex.com/which I would also recommend. It sits on you task bar and then pops up when you send emails to it. It allows you to then examine the email in quite some depth.
我知道这是一篇旧帖子,但我也知道http://smtp4dev.codeplex.com/我也会推荐它。它位于您的任务栏上,然后在您向其发送电子邮件时弹出。然后,它允许您深入检查电子邮件。
回答by Noon Silk
-- Edit:
- 编辑:
This advice only valid if you're using .NET
此建议仅在您使用 .NET 时有效
Check thisout. If you set it appropriately, it will just store your emails on disk :)
看看这个。如果您适当地设置它,它只会将您的电子邮件存储在磁盘上:)
SmtpClient client = ...;
client.PickupDirectoryLocation = @"c:\foo\emails\"; //"
client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
-- Edit
- 编辑
Just in case some people don't get it, this means you don't need another SMTP server for test/dev, you just set the variable appropriately.
以防万一有些人不明白,这意味着您不需要另一个用于测试/开发的 SMTP 服务器,您只需适当设置变量即可。
-- Edit
- 编辑
For completeness, as marc_sshows below, you can set this in configs nicely via:
为了完整起见,如下marc_s所示,您可以通过以下方式在配置中很好地设置它:
<system.net>
<mailSettings>
<smtp deliveryMethod="SpecifiedPickupDirectory">
<specifiedPickupDirectory
pickupDirectoryLocation="c:\foo\emails\" />
</smtp>
</mailSettings>
</system.net>
回答by Martin v. L?wis
回答by VVN
We used Mailtrapfor this. It give you remote smtp server account and direct access to all mails in it. So you just enter given smtp credential in your application and after that all email sent by your system will be visible on mailtrap. And you can easily look source code of mail, and download it to your local system. You can see example here
为此,我们使用了Mailtrap。它为您提供远程 smtp 服务器帐户并直接访问其中的所有邮件。因此,您只需在您的应用程序中输入给定的 smtp 凭证,然后您的系统发送的所有电子邮件都将在 mailtrap 上可见。您可以轻松查看邮件的源代码,并将其下载到您的本地系统。您可以在此处查看示例
On mailtrap you can have as many smtp account as you want( different account for different application environments, or different application) Also you can manage access to your account ( so only trusted people will se your emails) and you can forward some emails to real email addresses.
在mailtrap上,您可以根据需要拥有任意数量的smtp帐户(不同应用程序环境或不同应用程序的不同帐户)您还可以管理对您帐户的访问(因此只有受信任的人才能看到您的电子邮件)并且您可以将一些电子邮件转发到真实电子邮件地址。
回答by Santosh Gokak
Below are the links i found
下面是我找到的链接
A Simple SMTP Server Mock for .NET\ -- .NET
Dumbster-- Java
mocksmtpd-- Ruby
.NET 的简单 SMTP 服务器模拟\ -- .NET
笨蛋——Java
mocksmtpd-- 红宝石
Use depending on the Language and Platform of your choice.
根据您选择的语言和平台使用。
There is also an earlier post for .NET Testing SMTP with .net
还有一篇关于 .NET使用 .net 测试 SMTP的较早帖子
回答by TROLLLOL
Papercut (http://papercut.codeplex.com/discussions) is the simplest and most elegant one so far. Simple exe file that listens to port 25 and displays emails.
Papercut ( http://papercut.codeplex.com/discussions) 是迄今为止最简单、最优雅的剪纸。侦听端口 25 并显示电子邮件的简单 exe 文件。