|
[SMARTY] Re: block.sendmail.php: msg#00448php.smarty.general
>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> |
|---|---|---|
| Previous by Date: | Re: [SMARTY] Why won't this work?: 00448, Monte Ohrt |
|---|---|
| Next by Date: | Re: [SMARTY] PHPDoc and Smarty: 00448, Greg Beaver |
| Previous by Thread: | header e framesi: 00448, Rui Miguel Palma |
| Next by Thread: | [SMARTY] rebuild_cache() - just a thought: 00448, Hoffman, Geoffrey |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |