note 26140 deleted from ref.mail by nlopess
| From: | nlopess@php.net | Date: | Tue, 27 Apr 2004 13:16:26 +0000 |
| Subject: | note 26140 deleted from ref.mail by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-68874@lists.php.net to get a copy of this message | ||
Note Submitter: oliver.ahlberg@smp.se
----
I've found this quite convenient in mail functions distributing various newsletters with HTML
content:
function mail_from_file($template) {
$to = "you@you.com";
$title = "A message";
$header = ""; // Found elsewhere
$message = join('',file($template));
mail($to,$title,$message,$header);
}
/* PHP Code Body */
mail_from_file("newsletters/news2002-10-15.html");
This is just a short snippet from my code, and you'll probably want to make some string
replacements in the retrieved message templates to personalize the emails for your recipients.