I like to use the sendmail function on linux for email pranks. It lets me dictate the reply-to and from lines that the email displays, so I can make it look at first glance as if the email originates from someone else. Of course, a wise man will check the raw header and see jgoodson@AssholeU.edu as the actual sender (not a real email address).
Recently, a friend turned 30 and I decided to send my regards via an email welcoming him to the AARP. He saw right through it (wise man), but it was still amusing. Here's the code I used to send the email and the contents:
my $sendmail = "/usr/sbin/sendmail manny@smooveMail.com";
my $reply_to = "Reply-to: donotreply@AARP.orgn";
my $subject = "Subject: Welcome to AARP!n";
my $content = "Dear Manny Smoove,n
Welcome to the AARP, new member! n
As a member of AARP a world of exciting possibilities has opened up to you, including:n
-Discounts on travel and everyday savings
-Customized weather reports
-Information about health, money and more, including tips on dealing with the diabetes!
-CBS entertainment programming guide
-Guide to the exciting world of gray swingers
-Free membership for your spouse or partnern
Be sure to visit our website, AARP.org, for more information about your membership and to keep track of your benefits. Information to log in is on your membership card, which is in the mail at this moment!nn
my $to = "To: manny@smooveMail.comn";
my $from = "From: BettyWhite@AARP.ORG n";
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $reply_to;
print SENDMAIL $from;
print SENDMAIL $subject;
print SENDMAIL $to;
print SENDMAIL $content; close(SENDMAIL);
Names changed to protect the less innocent. My first go at this highlighted discounts on viagra, but when I tested it on my gmail account it alerted the spam filter.
Originally, I used this for fake library notices, informing fellow grad students that books such as Shiver Me Tensors: Physics of the Pirates of the Caribbean were overdue. The CERN library system did not appreciate the humor and informed IT security on me.