PHP send mail - Unable to send to Yahoo! email addresses

royyuuki

New Member
Messages
23
Reaction score
0
Points
0
Hi everyone, I am having a problem sending an email to the following domains:
  • @yahoo.com,
  • @hotmail.com, and
  • @msn.com
using the PHP mail() function. But there's no problem if I send an email to @gmail.com

Is there something wrong with my code? Thank you so much.
Code:
<?php
	$to = 'someone@yahoo.com';
	$subject = 'Sample Subject';
	$message = 'Hi. This is a sample message.';
	$headers = 'From: webmaster@royyuuki.elementfx.com' . "\r\n" .
	    'Reply-To: no-reply@royyuuki.elementfx.com' . "\r\n" .
	    'X-Mailer: PHP/' . phpversion();

	mail($to, $subject, $message, $headers);
	echo("Message sent!");
?>
 

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
The mail() function returns true or false depending on whether the mail was accepted for delivery.
PHP:
<?php
	$to = 'someone@yahoo.com';
	$subject = 'Sample Subject';
	$message = 'Hi. This is a sample message.';
	$headers = 'From: webmaster@royyuuki.elementfx.com' . "\r\n" .
	    'Reply-To: no-reply@royyuuki.elementfx.com' . "\r\n" .
	    'X-Mailer: PHP/' . phpversion();

	echo (mail($to, $subject, $message, $headers)) ? 'Message sent!' : 'Message not sent!';
?>
Post back your results.

I recommend you check your spam folder at those addresses. I have heard that mail sent from the free servers due to the amount of abuse goes directly to spam.
 
Last edited:

royyuuki

New Member
Messages
23
Reaction score
0
Points
0
I tried to execute the code below:
Code:
<?php
    $to = 'royyuuki@yahoo.com';
    $subject = 'Sample Subject';
    $message = 'Hi. This is a sample message.';
    $headers = 'From: webmaster@royyuuki.elementfx.com' . "\r\n" .
        'Reply-To: no-reply@royyuuki.elementfx.com' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();

    echo (mail($to, $subject, $message, $headers)) ? 'Message sent!' : 'Message not sent!';
?>

and got the following result:
Message sent!

and I also tried to check my inbox, and it's there!
Holy JESUS, are you some kind of like an angel or something?

What happened? I can't believe this. Hahaha, :nuts: ...
Thank you so much!! Now I can update my website and accept any email addresses.

Whew! :drool:
 

royyuuki

New Member
Messages
23
Reaction score
0
Points
0
What's going on? I was able to send email messages to any @yahoo.com email addresses, but right now.. it's not working again.
 

royyuuki

New Member
Messages
23
Reaction score
0
Points
0
When I first registered here at x10hosting.com, I wasn't able to send email messages to all email addresses but @gmail.com .. that's why I required everyone who's going to register on my website to have a gmail account. it's a must.

and then, i tried posting the problem here, and twinkie tried to help me by reproducing the issue.
amazingly, the problem didn't arise for some weird reason. i was able to send an email to @gmail.com, @yahoo.com, and @msn.com ...

but as of the moment, i can't send to @yahoo.com ... i also checked the spam folder, but the mail isn't there.

@msn.com , and @gmail.com is working perfectly just now.....


can someone please confirm this issue? is there something wrong with my header?
 

royyuuki

New Member
Messages
23
Reaction score
0
Points
0
When I first registered here at x10hosting.com, I wasn't able to send email messages to all email addresses but @gmail.com .. that's why I required everyone who's going to register on my website to have a gmail account. it's a must.

and then, i tried posting the problem here, and twinkie tried to help me by reproducing the issue.
amazingly, the problem didn't arise for some weird reason. i was able to send an email to @gmail.com, @yahoo.com, and @msn.com ...

but as of the moment, i can't send to @yahoo.com ... i also checked the spam folder, but the mail isn't there.

@msn.com , and @gmail.com is working perfectly just now.....


can someone please confirm this issue? is there something wrong with my header?


here's my code:

PHP:
<?php
    $to = 'myemailadd@yahoo.com';
    $subject = 'Sample Subject';
    $message = 'Hi. This is a sample message.';
    $headers = 'From: webmaster@royyuuki.elementfx.com' . "\r\n" .
        'Reply-To: no-reply@royyuuki.elementfx.com' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();

    echo (mail($to, $subject, $message, $headers)) ? 'Message sent!' : 'Message not sent!';
?>


and i got "Message sent!"
 

kbjradmin

New Member
Messages
512
Reaction score
2
Points
0
you may want to try sending the mail some way other than the PHP mail function. PHPMailer is a good SMTP/POP library for PHP...
 
Top