使用PHP发送html简报的脚本 [英] Script to send html newsletter using PHP

查看:52
本文介绍了使用PHP发送html简报的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我尝试了很多使用php邮件功能发送HTML代码,但是当发送电子邮件时,它会显示所有html标签(包括样式属性)。 br />

能告诉我任何使用PHP发送HTML格式的时事通讯的脚本。 (它应该只显示带有所有html属性而不是html标签的格式化文本)

Hi there,

I tried a lot to send HTML code using php mail fuction, but when email sent, it showing all html tags (including style property as well).

Can you please let me know any script to send HTML formatted newsletter using PHP. (It should show only formatted text with all html property and not html tags)

推荐答案

你必须在标题中将Content-type设置为''text / html ''。

但我建议使用电子邮件类来解决这个问题。


您确定接收电子邮件客户端是否允许使用HTML而不是转换纯文本?
You have to set Content-type in the header to be ''text/html''.
But I recommend using an email class to save this headache.

Are you sure the receiving email client is allowing HTML as such and not converting to plain text?


帮自己一个忙,并使用 SwiftMailer 。它附带了大量文档,因此设置HTML简报应该没有问题。
do yourself a favour and use SwiftMailer. it comes with an extensive documentation so there should be no problem setting up a HTML Newsletter.


感谢您的回复。

这是我的编码,有一个看。我已经包含了''text / html''。

但是它仍然没有用,你能让我知道其他这样的剧本吗?

Thanks for reply from you.
Here is my coding, have a look. I have already included ''text/html''.
But still it didn''t work, Can you let me know other such script?

展开 | 选择 | Wrap | 行号


这篇关于使用PHP发送html简报的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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