Re: [SMARTY] send smarty-display as email
| From: | Daniel Hedrick | Date: | Tue, 04 Oct 2005 13:46:10 +0000 |
| Subject: | Re: [SMARTY] send smarty-display as email | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-13072@lists.php.net to get a copy of this message | ||
On Oct 4, 2005, at 8:40 AM, Holger Wöhle wrote:
Can i change the direction of smarty->display to a handle or a variable wich i can then send through mime-enconding and smtp ?Instead of that, use smarty->fetch(...), as in this example that uses PEAR's Mail:mime, below: $msg = new Mail_mime( "\n" ); $msg->setTXTBody( $smarty->fetch( "/path/to/myTextTemplate.tpl.txt" ); $msg->setHTMLBody( $smarty->fetch( "/path/to/myHTMLTemplate.tpl.html" ); $body = $msg->get(); $hdrs = $msg->headers( $myheaders ); $mail =& Mail::factory( 'mail' ); $mail->send( $msg_recipient, $hdrs, $body ); HTH, -daniel -- http://www.hedrick.org/daniel?sig