+ Reply to Thread
Results 1 to 8 of 8
Like Tree2Likes
  • 1 Post By drf1229
  • 1 Post By drf1229

Thread: PHP Mail() not working for certain emails

  1. #1
    drf1229 is offline x10Hosting Member drf1229 is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    71

    PHP Mail() not working for certain emails

    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 Code:
    $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?
    dinomirt96 likes this.
    Your 14 year old web developer. If I can do it, you can!
    My site
    My iPhone App

  2. #2
    shadowslash's Avatar
    shadowslash is offline x10Hosting Member shadowslash is an unknown quantity at this point
    Join Date
    Nov 2008
    Location
    Philippines
    Posts
    61

    Re: PHP Mail() not working for certain emails

    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...

  3. #3
    drf1229 is offline x10Hosting Member drf1229 is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    71

    Re: PHP Mail() not working for certain emails

    Thanks for your response! Can you please elaborate on how to create a custom CGI engine, as I've never done this before?
    Your 14 year old web developer. If I can do it, you can!
    My site
    My iPhone App

  4. #4
    slacker3's Avatar
    slacker3 is offline x10 Sophmore slacker3 is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    145

    Re: PHP Mail() not working for certain emails

    PHP code seems ok, you may want to check mail()'s return value:
    http://www.php.net/manual/en/function.mail.php

    mail() should use sendmail per default (on a linux box)
    did you check your spam folder?

  5. #5
    drf1229 is offline x10Hosting Member drf1229 is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    71

    Re: PHP Mail() not working for certain emails

    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?
    karimirt47 likes this.
    Your 14 year old web developer. If I can do it, you can!
    My site
    My iPhone App

  6. #6
    kbjradmin's Avatar
    kbjradmin is offline x10 Elder kbjradmin is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    Washington State, USA
    Posts
    512

    Re: PHP Mail() not working for certain emails

    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

  7. #7
    drf1229 is offline x10Hosting Member drf1229 is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    71

    Re: PHP Mail() not working for certain emails

    I tried using smtp and the message sends but I still don't receive it.
    Your 14 year old web developer. If I can do it, you can!
    My site
    My iPhone App

  8. #8
    drf1229 is offline x10Hosting Member drf1229 is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    71

    Re: PHP Mail() not working for certain emails

    Found a solution!!! Try using smtp through gmail (making an account of course!) instead of x10hosting!
    Your 14 year old web developer. If I can do it, you can!
    My site
    My iPhone App

+ Reply to Thread

Similar Threads

  1. Can't send emails from squirrel mail
    By muffraider in forum Free Hosting
    Replies: 2
    Last Post: 02-12-2010, 06:44 PM
  2. ya no puedo enviar emails por php mail (Stoli)
    By palantir in forum Soporte
    Replies: 1
    Last Post: 10-29-2009, 08:55 PM
  3. Can't get emails working
    By sprnews4u in forum Free Hosting
    Replies: 5
    Last Post: 02-20-2008, 03:45 PM
  4. Replies: 5
    Last Post: 07-12-2005, 06:00 PM
  5. Server Update emails/Latest news Emails
    By Cycloneflame in forum Feedback and Suggestions
    Replies: 2
    Last Post: 04-30-2005, 11:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers