Can I add div tag to my mail()?
Posted: Thu Apr 16, 2009 10:46 pm
hello,
this might be more related to css, but i figured that i would start here... i am trying to add my logo to my mail(). i would like to add a <div> and have the image coming from my css style sheet. reason being that i have noticed many mail hosts make users accept images in order for them to display and it also seems to make the mail more prone to end up in the spam/junk folder for some reason.
i've got this, but the image is ignored in my mail()... any ideas? is it possible? thank you!
css:
php:
this might be more related to css, but i figured that i would start here... i am trying to add my logo to my mail(). i would like to add a <div> and have the image coming from my css style sheet. reason being that i have noticed many mail hosts make users accept images in order for them to display and it also seems to make the mail more prone to end up in the spam/junk folder for some reason.
i've got this, but the image is ignored in my mail()... any ideas? is it possible? thank you!
css:
Code: Select all
#emailLogo {
background: url(Images/logo.jpg);
}
Code: Select all
$email = $row_getALLemails['email'];
$comment = $row_getALLemails['comment_title'];
$subject = "New comment";
$message = "
<head>
<title>mysite</title>
</head>
<body>
<div id ='emailLogo'></div>
<h3>Hello, $username!</h3>
<p>You have a NEW comment in this conversation: </p>
<h4>$comment</h4>
<p>Login at http://www.mysite.com.
<p>Click the conversation topic to view, discuss, and share!</p>
<p>Thank you,<br />
the mysite community</p>
<p>--This is an automated response, please do not reply--</p>
</body>
</html>
";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$headers .= 'Content-type: image/jpg;' . "\r\n";
$headers .= 'From: mysite <me@mysite.com>';
mail($email, $subject, $message, $headers);