Mail() and html
| From: | gregory landry | Date: | Sat, 14 Jun 2003 10:22:51 +0000 |
| Subject: | Mail() and html | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-151471@lists.php.net to get a copy of this message | ||
Good Morning,
Hopefully I'm not asking questions that are too basic. I am new to this list
and new to PHP. If my questions are too basic please let me know and I'll
direct them elsewhere.
I'm at a very basic level with PHP. I'm working with form data and sending
the information out in emails. That is not a problem. What I would like to
do is send out an email with the information from the form in html format.
I've seen many examples and the one below works fine for me. But I would
like to be able to add a body tag to $mailbody below so I can color the
background of the html page that is being sent out via email. Can someone
explain to me what I have to add to the following to make this happen?
Thanks,
Greg
This works but I can't change the background color of the html email:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
print "Hello there";
$to = "glandry1@maine.rr.com"; // Where the e-mail is sending to.
$subject = "This Is A Test!"; // The subject of the e-mail.
$name = "Greg Landry"; // Your name, the from name.
$email = "glandry1@maine.rr.com"; // Your e-mail, the from address.
$mailbody = "<hr>Test<hr><Br><Br><img src=\"
<http://www.portcityportlandmaine.com/php/clients.jpg\>
$name'>http://www.portcityportlandmaine.com/php/clients.jpg\"><Br><br>$name"
;
mail("$to", "$subject", "$mailbody", "From: $name
<$email>\n" .
"MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1");
?>
</body>
</html>