Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [SMARTY] lookin for an example using Smarty template fore sending mail
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

Report this thread to moderator Post Follow-up to this message
Old Post
Messju Mohr
04-07-05 01:59 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Smarty Templates archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:04 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.