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.