Ich verwende den PHP Mailer um eine HTML Email zu senden. Allerdings, wenn ich die E-Mail unter dem gesamten Padding senden, sind Rand, div Größen etc. weg (in Outlook). Wenn ich mir mein Google Mail-Konto anschaue, sieht es gut aus. In der iPhone Mail App ist der Rand usw. auch weg.sende html via phpmailer
<div id="wrapper" style="width: 100%;">
<table width=600 style="margin:0 auto">
<tbody>
<tr>
<td>
<div id="Banner" style="
max-width: 640px;
margin: 0 auto;
min-height: 60px;
background-color: #75dcfc;
width: 100%;
">
<div class="center" style="margin: auto;text-align: center;">
<img src="logourl" alt="test" style="max-width: 450px;padding-top: 0px;width: 50%;">
</div>
</div>
<div id="box" style="max-width: 640px;width: 100%;background-color: white;color: #696969;border-style: solid;border-width: 0px;text-align: center;border-color: #d3d3d3;margin-left: auto;margin-right: auto;overflow: hidden;padding: 0px;border-style: solid;height: 500px">
<div id="personalmsg" style="width: 100%;text-align: center;font-size: 22px;margin-left: auto;margin-right: auto;max-width: 400px;padding: 0px;">
<p style="text-align: left;font-size: 17px;margin-top: 50px; color: #000;font-weight: normal;font-style: normal;">hello</p>
</div>
</div>
<h2 id="link" style="text-align: center;max-width: 640px;margin: 0 auto;background-color: #75dcfc;padding-top: 15px;padding-bottom: 15px;width: 100%;"><a href="website" style="color: #fff;text-decoration: none;">Visit us</a></h2>
</td>
</tr>
</tbody>
</table>
</div>
Wie Sie sehen können, verwende ich nur Inline-CSS. aber ich verstehe nicht, was ich falsch mache. Vielleicht hilft es, zu zeigen, wie ich die E-Mail senden:
$mail = new PHPMailer;
$mail->setFrom('[email protected]');
$mail->addAddress($email);
$mail->Subject = "Your Email";
$mail->Body = $html;
$mail->isHTML(true);
try {
$mail->Send();
}
catch (Exception $e) {
}
Während $ html die HTML als String hält.
Ich bin dankbar für jede Kanne in der richtigen Richtung
Stellen Sie sicher, dass Sie das vollständige HTML-Markup verwenden. Es scheint hier nicht der Fall zu sein, zumindest nicht für das, was du gepostet hast. Und/oder es könnte ein lokales Problem mit Ihrem Outlook sein. –