[英]PHP SMTP Mail alternatives to make it look prettier
I currently am using: 我目前正在使用:
mail($to, $subject, $body, $headers);
To send emails to my members. 向我的会员发送电子邮件。 The content of the email is been stored within the $body variable which makes it really difficult for template usage and basic attractiveness of the email.
电子邮件的内容被存储在$ body变量,这使得模板的使用和电子邮件的基本吸引力,它真的很难中。
My question is, is there an alternative or a method to implement a template into these sort of emails instead of the bog standard logo and text which looks horrendous! 我的问题是,是否有替代方法或方法可将模板实施到此类电子邮件中,而不是看起来像可怕的沼泽标准徽标和文本!
Many thanks, 非常感谢,
The method of sending the mail has nothing to do with its appearance. 发送邮件的方法与它的外观无关。 You can take any template engine you like and put it's output into $body.
您可以使用任何喜欢的模板引擎,并将其输出到$ body中。 You should, however, embed it in a multipart message that contains a text/plain and a text/html part.
但是,您应该将其嵌入包含文本/纯文本和文本/ html部分的多部分消息中。
Take a look at SendGrid . 看一下SendGrid 。 They have a free plan for 200 emails a day and a simple REST API to send emails.
他们有每天200封电子邮件的免费计划,还有一个简单的REST API发送电子邮件。 You'll be able to make good looking templates and avoid the pain of sending email .
您将能够制作美观的模板,并避免发送电子邮件的麻烦 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.