As far as I know, all this websites such as, yahoo, gmail and etc. are doing their best to prevent any spam and if they wont like your mail, you wont even be able to see it in spam folder. so what I've did was this, set the headers and it worked...!!!
PHP Code:
$email = "someone@somewhere.org"; // TO
$subject = "MAIL SUBJECT"; // Subject
$message = "MESSAGE TO SOMEONE, LIKE WELCOME TO www.codingforums.org"; //Message
//Email Headers
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "Date: ". date('r'). "\n";
$headers .= "Return-Path:your@email.com\n";//wtf?
$headers .= "Errors-To:your@email.com\n";//If sending will fail, any errors will be send to this email
$headers .= "From:FromWho <your@email.com>\n";
$headers .= "Reply-to:replty@yourweb.com\n"; //Reply email, basicaly if user will click on button reply it will be sended to this email
$headers .= "Organization: ORGANIZATION\n"; //basicly your organization, but i believe it will work without it
$headers .= "X-Sender:email@somewhere.org\n"; //SENDER EMAIL (your email e.g. info@yourweb.com
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: PHP/" . phpversion();
//as you can see nearly after each line, there is \n, leave it like that, dont add \r, otherwise your users who use gmail wont get anything
//Email Headers End
if (mail($email, $subject, $message, $headers))//SEND MAIL
{
//if successfull show this message
echo "Mail was send successfully!";
}
else
{
//if unsuccessfull
echo "Mail was send UNsuccessfully!";
}