最好的方式做html电子邮件,通过php发送? [英] Best way to do html e-mail, sending via php?

查看:155
本文介绍了最好的方式做html电子邮件,通过php发送?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前从来没有做过html电子邮件,我刚刚使用 http:// www。 postmarkapp.com

I've never done html e-mail before, I've just set up php mail using http://www.postmarkapp.com

我想知道我将如何发送php邮件作为html?

I was wondering how I would go about sending php mail as html?

有人有任何预览的php页面发送html电子邮件我可以看看得到它的工作原理吗?

Does anybody have any previews of a php page sending html e-mail I can look at to get the jist of how it works?

目前我只是把文本变成一个变量并发送它作为一个消息,它是如何为html?

Currently I'm just putting text into a variable and sending it as a message, how is it done for html?

关心

推荐答案

您还想使用邮戳发送电子邮件吗?

Do you still want to use Postmark to send emails?

在邮戳中,您设置 TextBody 属性到您的消息的文本版本,以及 HtmlBody 属性到其html版本。总是包括两者都是好的做法。根据您的用户的电子邮件客户端是否支持HTML,将会呈现相应的消息表单。详细了解此此处

In Postmark, you set the TextBody property to the text version of your message, and the HtmlBody property to the html version of it. It is good practice to always include both. Depending on whether your user's email client supports HTML or not, the appropriate message form is rendered. Read more on this here.

编辑:添加了一个例子。我通常喜欢将我的字符串分割成单独的行,这样我可以像一个真正的HTML文件一样缩进它。当然,如果你使用了模板,那将会更好一些。

Added an example. I generally like splitting my string into separate lines so that I can indent it nicely like a real HTML file. Of course, if you used templates, that would make it so much better.

$htmlBody = "
<html>
    <body>
        Thank you for using our app!<br />
        - Super Awesome App Team
    </body>
</html>
";

这篇关于最好的方式做html电子邮件,通过php发送?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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