
At which point are you getting the errors? At $mailit = mail($to,$subject,$message,$headers); or the mail server later returns a delivery error? On Tue, Nov 10, 2009 at 4:34 PM, Peter Kip <peter.kipkoech@gmail.com> wrote:
Guys,
I'm experiencing some problem with the mail() function. I have a feedback form I want to incorporate into the site, it is working fine with the commercial mail platforms like Gmail, Yahoo...., but it can't send mail when the values of the $to variable are POP based mail systems.
This is the sample code.
<?php
$yourName = 'Online Commercial '; $yourEmail = 'peter.koech@gmail.com, peter.kipkoech@gmail.com';
$yourSubject = 'Lorem Lipsum'; $referringPage = 'http://www.standardmedia.co.ke';
function cleanPosUrl ($str) { return stripslashes($str); } if ( isset($_POST['sendContactEmail']) ) { $to = $yourEmail; $subject = $yourSubject.': '.$_POST['posRegard']; $message = cleanPosUrl($_POST['posText']); $headers = "From: ".cleanPosUrl($_POST['posName'])." <".$_POST['posEmail'].">\r\n"; $headers .= 'To: '.$yourName.' <'.$yourEmail.'>'."\r\n"; $mailit = mail($to,$subject,$message,$headers); if ( @$mailit ) { header('Location: '.$referringPage.'?success=true'); } else { header('Location: '.$referringPage.'?error=true'); } } ?>
-- Nothing’s impossible the impossible just takes a little longer.
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general