You are here: Re: HTML email with PHP tags « All PHP « IT news, forums, messages
Re: HTML email with PHP tags

Posted by bob.chatman@gmail.com on 10/24/06 15:45

You do it just like you do anything else in php, just print them in
there.

<?php
mail('recipient@some.net', 'Subject',
"<html><body><p>Username = $username<br />\nPassword =
$password</p></body></html>",
"To: The Receiver <recipient@some.net>\n" .
"From: The Sender <sender@some.net>\n" .
"MIME-Version: 1.0\n" .
"Content-type: text/html; charset=iso-8859-1");
?>

the only thing you would want to change would be the single quotes
around the body.

UKuser wrote:
> Hi Guys,
>
> Not sure if this is possible.
>
> If I'm sending HTML emails, how can I include PHP tags? I've tried the
> standard <?php tags and just inserting them anyway, but neither seem to
> work. I really just want to format the text to make it look better
> rather than putting images etc.
>
> I.e. using this example from sitepoint.com
>
> <?php
> mail('recipient@some.net', 'Subject',
> '<html><body><p>Your <i>message</i> here.</p></body></html>',
> "To: The Receiver <recipient@some.net>\n" .
> "From: The Sender <sender@some.net>\n" .
> "MIME-Version: 1.0\n" .
> "Content-type: text/html; charset=iso-8859-1");
> ?>
>
> Within the <html> tags I'd like to include variables like $usernames
> etc.
>
> Thanks
>
> A

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация