有什么快速、简单的方法可以向我自己发送 HTML 电子邮件来测试它们?

问题描述 投票:0回答:16

我的任务是针对不同的电子邮件/网络邮件客户端优化 HTML 电子邮件。我曾经通过在 Outlook Express 中执行一个技巧来测试 HTML 文件,使其发送原始 HTML,但微软现在似乎已经停止提供 Outlook Express(我认为“Live Mail”应该取代它)。

所以我的问题是,有没有一种简单、快捷的方法来发送 HTML 电子邮件?甚至可能是一个可以完成这项工作的免费软件程序?

html email testing send
16个回答
21
投票

Puts Mail 是目前最好的选择。查看 Puts Mail 创建者对类似问题的回答


4
投票
我会使用 python,底部是如何创建默认文本的 HTML 电子邮件的示例:

http://docs.python.org/library/email-examples.html 您可以对其进行参数化,封装在函数中,从文件中读取内容等(请确保您将“s = smtplib.SMTP('localhost')”中的 localhost 设置为您的 smtp 服务器)


4
投票
如果您只是想测试 HTML 电子邮件是否在各种客户端中正确显示,我会使用

sendmail.exe(仅限 Windows)。

您可以保存 .html 文件并将其作为电子邮件内容通过命令行传输到该程序中。有来自/到/主题/服务器等的命令行选项

这将允许您通过编辑 .html 文件并再次运行命令行来快速发送和重新发送电子邮件。无需编程。

编辑:Linux 上有一个类似的同名命令行工具。


2
投票
我不会

甚至去任何语言... 我会停在

MailChimp 并设置一个 免费帐户(最多 500 个订阅者,每月发送 3000 次)... 3000 次发送足以测试,对吗? :) 它拥有专业发送电子邮件所需的所有工具(也许还可以为您的客户/朋友设置一个帐户,以便他们/他可以在新闻通讯中使用 MailChimp)

当您使用它时,请查看他们的

资源

页面以及完美的工具,以了解我们可以使用CampaignMonitor自己的电子邮件客户端中的CSS支持指南在新闻通讯中使用什么 希望有帮助


2
投票

require "mail" options = { :address => "smtp.gmail.com", :port => 587, :domain => "smtp.gmail.com", :user_name => "[email protected]", :password => "password", :enable_starttls_auto => true, :authentication => :plain, } Mail.defaults do delivery_method :smtp, options end mail = Mail.new do to "[email protected]" from "Me Me [email protected]" subject "test email" html_part do content_type "text/html; charset=UTF-8" body File.read("index.html") end end mail.deliver

不要忘记启用来自 
https://www.google.com/settings/security/lesssecureapps

的访问


1
投票

http://www.mozillamessaging.com/en-US/thunderbird/

这是我用来发送测试电子邮件的。或者我想您也可以使用您的电子邮件提供商。


1
投票

http://www.ravelrumba.com/blog/send-html-email-with-safari-mail-for-fast-testing/


1
投票

在网络浏览器(如网页)中查看

渲染

html,然后ctrl+a选择整个页面,然后

ctrl+c
复制并
ctrl+v
将渲染的html结果粘贴到电子邮件正文中。没有比这更容易的了...

请注意,如果您希望收件人看到您的图像,则需要托管它们。


1
投票

using System.Net; using System.Net.Mail; var fromAddress = new MailAddress("[email protected]", "From Name"); var toAddress = new MailAddress("[email protected]", "To Name"); const string fromPassword = "fromPassword"; const string subject = "Subject"; const string body = "Body"; var smtp = new SmtpClient { Host = "smtp.gmail.com", Port = 587, EnableSsl = true, DeliveryMethod = SmtpDeliveryMethod.Network, UseDefaultCredentials = false, Credentials = new NetworkCredential(fromAddress.Address, fromPassword) }; using (var message = new MailMessage(fromAddress, toAddress) { Subject = subject, Body = body }) { smtp.Send(message); }

请参阅
通过 Gmail 在 .NET 中发送电子邮件

了解更多详细信息


0
投票
测试邮件服务器工具

可以提供帮助。


0
投票
PHPMailer

发送 HTML 电子邮件(通常是批量)。它对我来说非常有效。


0
投票
PowerShell


0
投票

function sendHtml(recipients, subject, html) { var mail = Server.CreateObject("CDO.Message"); mail.From = "Tester <[email protected]>"; mail.Subject = subject; mail.To = recipients.join(";"); mail.HTMLBody = html; // Do the following if you want to directly use a specific SMTP server mail.Configuration.Fields.Item( "http://schemas.microsoft.com/cdo/configuration/sendusing") = 2; mail.Configuration.Fields.Item( "http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.example.com"; mail.Configuration.Fields.Item( "http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25; mail.Configuration.Fields.Update(); mail.Send(); }

注意:

但是,使用此方法您的 HTML 可能会稍微重新格式化。


0
投票


0
投票

但是您可以使用 Thunderbird Mail 极其轻松地发送 HTML 电子邮件。

点击“写”撰写新邮件
  1. 点击进入电子邮件正文
  2. 插入 --> HTML
  3. 尽管您必须将内容粘贴到弹出的框中,而不是发送文件本身。

请务必仔细检查您的帐户设置和电子邮件特定设置是否已设置为允许 HTML 电子邮件(我相信这是默认设置)。

Thunderbird

是免费、跨平台(Mac、Windows 和 Linux)、开源的,由 Mozilla 维护


-1
投票

您可以读取电子邮件模板并分配给 MailMessage 正文。

发送电子邮件

System.Net.Mail.MailMessage msg = CreateMailMessage(); SmtpClient sc = new SmtpClient(); sc.Host = ConfigurationManager.AppSettings["SMTPServer"]; sc.Port = 0x19; sc.UseDefaultCredentials = true; sc.Send(msg);

© www.soinside.com 2019 - 2024. All rights reserved.