如何创建从php发送的响应式电子邮件? [英] How create responsive email that send from php?

查看:56
本文介绍了如何创建从php发送的响应式电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建响应电子邮件,就像在此处输入图片描述

How to create responsive email just like enter image description here

我看到许多响应式电子邮件具有相同的设计,其中中间的内容以及左右两侧的空间都有不同的颜色.在移动设备中打开电子邮件时,左右两边的空间都消失了.看起来他们用我不知道怎么做的相同方式创建它.我使用php这样发送电子邮件

I see many responsive email have same design which the content in the middle and there is space in right and left side with different color. When the email opened in the mobile device the space in the right and left are gone. Looks like they create it with same way that i dont know how. I send email using php like this

$mail = new PHPMailer(); 
$mail->IsSMTP(); 
$mail->SMTPDebug = 2;  
$mail->SMTPAuth = true; 
$mail->SMTPSecure = 'ssl'; 
$mail->Host = "xxxx";
$mail->Port = xxx; 
$mail->IsHTML(true);
$mail->Username = "xxxx";
$mail->Password = "xxxxx";
$mail->SetFrom("xxxx");
$mail->Subject = "xxxx";
$mail->Body = $htmlContent;
$mail->AddAddress("xxxx@gmail.com");

$ htmlContent 是html的模板.我已经阅读了一些有关CSS必须是内联样式或无法加载的信息.但是,如果是内联的,那么如何使用引导程序之类的库.我真的是初学者.任何帮助将不胜感激.谢谢.

$htmlContent is the template of html. I've read some information that the css must be inline styles or wouldn't loaded. But if it was inlines then how to use some library like bootstrap, etc. I really beginner about this. Any helps will be apreciated. Thanks.

推荐答案

我个人不会尝试自己创建类似的东西.您可以使用许多很棒的软件包.我会为您提供一些提示:

Personally I would not try to create something like this on your own. There are many awesome packages you can use. I will note some for you:

祝你好运!:-)

这篇关于如何创建从php发送的响应式电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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