Apologies for x-posting.
I am trying to embed dynamic elements collected from a form in a mime
mail. The form sends elements to other pages, a database, and a text
mail() message; but, I am unable to send it to a mime e-mail message. I
am guessing the problem is in the definition of the dynamic element in
the $html section. A test email snippet follows. For the purposes of
the test, I set it up to receive the definition of an element [regdate]
that is defined within this file - not an external form so I can get the
php and html syntax correct.) The mime mail e-mails correctly but does
not include the data from the defined element - the output is simply:
"$regdate; HTML version of email".
I've tried numerous interations including adding the php definition <?
php print "regdate"; ?> in the $html section of the message. Any help is
appreciated!
<?php
include('Mail.php');
include('Mail/mime.php');
?>
<?php
//set regdate
$regdate = date("Y-m-d");?>
<?php
$text = 'Text version of email';
$html = '<html><body>
$regdate;
HTML version of email</body></html>';
$crlf = "\n";
$hdrs = array(
'From' => 'g***@gcfi.org',
'Subject' => 'Test mime message'
);
$mime = new Mail_mime($crlf);
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('mail');
$mail->send('t***@mydomain.org', $hdrs, $body);
?>