Code Comments
Programming Forum and web based access to our favorite programming groups.On Thu, Apr 07, 2005 at 12:22:12AM +0200, lpenou wrote: > Hi list, > > I'm looking for an example using a template to send an email, best > will be an HTML + text email > dis somenone already publish somewhere an example ? i like the phpmailer for advanced mailing from php. see: http://phpmailer.sourceforge.net/ with that you only nee $smarty->fetch() to get the rendered template as a string and assign that as mail-body to phpmailer. a simple example: /* here initialize $smarty, assign vars etc. */ require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->Body = $smarty->fetch('html_mail.tpl'); $mail->AltBody = $smarty->fetch('text_mail.tpl'); $mail->AddAddress($to_email, $to_full_name); if(!$mail->Send()) { echo "There has been a mail error sending to " . $row["email"] . "<br>"; } else { // mail was successfully sent. } greetings messju
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.