PHP Mail() not working for certain emails

drf1229

New Member
Messages
71
Reaction score
1
Points
0
For some odd reason PHP mail() supports only certain emails. I'm trying to create an email confirmation system, but I can't do that if certain emails do not work. Heres what I have:

PHP:
$to = "MyWork1229@gmail.com";
$subject = "New visitor";
$message = "A new visitor with the ip $ip has visited your site! \n \n The total list is: $filetext1";
$from = "drflax@comcast.net";
$headers = "From: $from";
mail($to,$subject,$message,$headers);

MyWork1229@gmail.com doesn't work. I've also tried the email drflax@comcast.net and got no luck. Finally, I tried my email algebrahelpsupport@gmail.com an it successfully sent the email. Is there any solution to this?
 

shadowslash

Member
Messages
61
Reaction score
0
Points
6
I've had this problem before, I sorta had a work around for it by using a custom CGI engine and running the sendmail application found in linux instead...
 

drf1229

New Member
Messages
71
Reaction score
1
Points
0
Thanks for your response! Can you please elaborate on how to create a custom CGI engine, as I've never done this before?
 

drf1229

New Member
Messages
71
Reaction score
1
Points
0
Mail() always returns true, yet the message isn't anywhere to be found in certain emails. In the email that works, it shows up in the junk folder. I'm going to look into shadowslashes solution, any suggestions for that?
 

kbjradmin

New Member
Messages
512
Reaction score
2
Points
0
my suggestion would be to not use the PHP mail() function, but to use SMTP. there is a really good SMTP/POP library for PHP called PHPMailer
 

drf1229

New Member
Messages
71
Reaction score
1
Points
0
I tried using smtp and the message sends but I still don't receive it.
 

drf1229

New Member
Messages
71
Reaction score
1
Points
0
Found a solution!!! Try using smtp through gmail (making an account of course!) instead of x10hosting!
 
Top