note 40177 deleted from function.mail by derick

From: Date: Sat, 15 May 2004 13:17:53 +0000
Subject: note 40177 deleted from function.mail by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-69635@lists.php.net to get a copy of this message
Note Submitter: arto.PLEASE.DO.NOT.SPAM@artoaaltonen.fi ---- I had problems with Hotmail spam blocking. Account activations etc. were moved to Junkbox. Got it working with this function. Hope this save someones time: <?php function mymail($to, $title, $body, $from = '') { $from = trim($from); if (!$from) { $from = 'My Name <myaccount@mydomain.com>'; } $rp = 'ReturnNonWorkingHere@MySite.net'; $org = 'MySite.net'; $mailer = 'MKSR-Postimies'; $head = ''; $head .= "Content-Type: text/plain \r\n"; $head .= "Date: ". date('r'). " \r\n"; $head .= "Return-Path: $rp \r\n"; $head .= "From: $from \r\n"; $head .= "Sender: $from \r\n"; $head .= "Reply-To: $from \r\n"; $head .= "Organization: $org \r\n"; $head .= "X-Sender: $from \r\n"; $head .= "X-Priority: 3 \r\n"; $head .= "X-Mailer: $mailer \r\n"; $body = str_replace("\r\n", "\n", $body); $body = str_replace("\n", "\r\n", $body); return mail($to, $title, $body, $head); } ?>

« previous php.notes (#69635) next »