Re: HTML email with PHP tags



Sure you can. In your variable where you are writing your HTML, insert
your PHP variables using the " . . " concatenation methods.

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@xxxxxxxx', 'Subject',
'<html><body><p>Your <i>message</i> here.</p></body></html>',
"To: The Receiver <recipient@xxxxxxxx>\n" .
"From: The Sender <sender@xxxxxxxx>\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


.



Relevant Pages

  • No <? or <?php in Windows
    ... I recently installed PHPTriad to a new server and the <? ... and <?php tags do ... not work on ANY html page. ...
    (php.general)
  • Re: HTML and PHP Parser
    ... >Anybody know html parser writing in java which take in account php tags ... >and could work with non-valid html or processing peace of html document ... http://mindprod.com Again taking new Java programming contracts. ...
    (comp.lang.java.programmer)
  • Re: Error: RCPT TO: error (550 relay not permitted)
    ... http://alma.ch/perl/Mail-Sendmail-FAQ.html#HTML) on sending html emails w/ PERL. ... $plain = encode_qp $text; ... Contact the administrator of that server, ...
    (comp.lang.perl.modules)
  • Re: error while using SmtpMail to send a simple html formatted message
    ... I have complete sample code at: ... including sending html emails. ... It was a HTML formatted message, if I try to use Text BodyFormat it sent ... But my need is to send a HTML formatted message. ...
    (microsoft.public.dotnet.framework)
  • Re: HTML email using PHP problem (Receive html tags)
    ... Sending HTML emails is somewhat of a rocket science. ... recommended that you use a library like Swift Mailer <http:// ...
    (comp.lang.php)