logo       

[SMARTY] Re: block.sendmail.php: msg#00448

php.smarty.general

Subject: [SMARTY] Re: block.sendmail.php

>Is there an update for your Plugin "block.sendmail.php" available,
>or is the 0.1 the right version?
>
>http://marc.theaimsgroup.com/?l=smarty-general&m=102323965311399&w=2

that is the only version, but it should - I haven't worked on
it since, nor have I used it myself ... I got flamed for making
it ;) and I have to say I agree with Monte and the others now -
email sending functionality does not belong in a plugin, it
should be kept in PHP instead, where the designer can't touch it.

see this follow up on my post:

http://marc.theaimsgroup.com/?l=smarty-general&m=102323987011529&w=2

A better solution is to use this alternative send_mail function
in your PHP script:

function send_mail($myname, $myemail, $contactname, $contactemail, $subject,
$message) {
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: php\n";
$headers .= "From: \"".$myname."\" <".$myemail.">\n";
return(mail("\"".$contactname."\" <".$contactemail.">", $subject, $message,
$headers));
}

And then keep your email message in a template by itself, separate
from your HTML - render it and send it from your script like so:

send_mail("me", "me@xxxxxx", "you", "you@xxxxxxx", "Hey, You!",
$smarty->fetch("my_email.tpl"));

the rest of the list will probably agree with me when I say, this
is the most appropriate way to do it? :)

/ Rasmus




--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise