Page 1 of 1
Mail function formatting?
Posted: Tue Mar 18, 2008 11:23 am
by spacebiscuit
Hi,
I am using the mail php function. Is it possible to add formatting to the body email text?
Many thanks in advacne,
Rob.
Re: Mail function formatting?
Posted: Tue Mar 18, 2008 11:33 am
by scriptah
Re: Mail function formatting?
Posted: Tue Mar 18, 2008 11:43 am
by spacebiscuit
Perfect thanks!
Rob.
Re: Mail function formatting?
Posted: Wed Mar 26, 2008 7:55 am
by spacebiscuit
I am following example 4 but I am having trouble displaying ph data in my email, is this possible with this method?
Here is my example code:
Code: Select all
$to = "$email";
$subject = "Example e-mail testing";
$body='
<html>
<head>
</head>
<body>
<p>Hello $name - this is a test....</p>
</body>
</html>';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $body, $headers);
When I receive the email the php data is not displayed, I just see the variable name.
Any ideas?
Thanks,
Rob.
Re: Mail function formatting?
Posted: Wed Mar 26, 2008 8:09 am
by spacebiscuit
I solved the problem, I had to change the quote to a double quotation as follows:
to..
Thanks,
Rob.