Untitled

mail@pastecode.io avatar
unknown
php
2 years ago
489 B
7
Indexable
Never
<?php
$from = "Willy Wonka <willy@wonka.com>";
foreach(file('list.txt') as $line)
    {
    list($email, $name) = explode("\t", $line);
    list($firstname) = explode(' ', $name);
    $subject = "Hi $firstname! The chocolate is all yours.";
    $body = "Hi $firstname — 
Those other kids are awful. You deserve it all. Come and get it.
--
Willy Wonka — willy@wonka.com — http://wonka.com
";
    mail($email, $subject, $body, $from);
    print "$email sent\n";
    }
?>