hello for all
i try to make mail function and its work correctly only with hotmail and yahoo not works
this is my code:
<?php
/**
* mail class allow have all mailing functions
*
*/
class mail {
/**
* send single email
*
* @param varchar $name_sender
* @param varchar $name_reciever
* @param email $from
* @param email $to
* @param varchar $subject
* @param text $text
* @return bool
*/
function singleMail($name_sender,$name_reciever,$from,$to,$subject,$text)
{
//email headers
$headers = "From: $name_sender <$from>\r\n";
$headers .= "Reply-To: $from\r\n";
$headers .= "Date: " . date("r") . "\r\n";
$headers .= "Return-Path: $from\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Message-ID: " . date("r") . $_SERVER["name"]."\r\n";
$headers .= "Content-Type: text/html;charset=iso-8859-1\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "Importance: High\r\n";
$headers .= "X-MXMail-Priority: High\r\n";
$headers .= "X-Mailer: PHP Mailer 1.0\r\n";
$headers .= "CC: \r\n";
$headers .= "BCC:\r\n";
//change charset from windows-1256 to US-ASCII to make text RFC 2047
$from = iconv('windows-1256','US-ASCII',$from);
$to = iconv('windows-1256','US-ASCII',$to);
//sending
return mail($to,$subject,$text,$headers,'-f'.$to);
}
}
it recieved as a junk email and spam
hope can help
thanks and regards