email and fetch
| From: | Travel Jadoo | Date: | Sun, 06 Apr 2003 11:07:59 +0000 |
| Subject: | email and fetch | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-9144@lists.php.net to get a copy of this message | ||
I came across the email of 14 Feb on the mailing list but couldn't find
a answer.
Anybody got an idea?
Thanks,
Alfred
Hi,
I hope that I can get some help on this one. My site sends out a
registration email, and I am trying to use Smarty to define the layout
of the email. So my email template looks something like this:
e_register.tpl
----------------------------
Hello {$username},
Welcome to {#siteName#}. Your username is {$username} and your password
is {$password}. You can log in by going to {#siteURL#}login.php.
Regards,
{#siteName#} Webmaster
-----------------------------
Then I do the following in my PHP script to get the output of that
template to send:
register.php
-----------------------------
$tpl->assign("username",$username);
$tpl->assign("password",$password);
$body = $tpl->fetch("email/e_register.tpl");
$tpl->clear_all_assign();
-----------------------------
And then I simply make $body be the body for the email and use phpmailer
to send out the email. But! The email is coming through with spaces all
missing. All the blank lines are gone and tabs are gone. Anyone got any
ideas as to how to include the template in the email without losing all
the formatting? I don't want to send HTML email, I like plaintext, and I
have searched through the documentation and the Wiki for any existing
examples.
Regards,
Paul Lockaby
--
www.traveljadoo.com - We add magic to your travel