Closed Thread
Results 1 to 3 of 3

Thread: PHP Mail Function Still Not Working

  1. #1
    dusmar93 is offline x10Hosting Member dusmar93 is an unknown quantity at this point
    Join Date
    Oct 2011
    Posts
    19

    PHP Mail Function Still Not Working

    The PHP mail function is still not working on my site. No one can receive registration emails.

    Here is my site info:
    • Domain: wilsonwesthh.elementfx.com
    • Hosting Server: starka
    Any idea what is going on? Is it a setting that I need check on? It was working when I first setup my Wordpress site and now it hasn't worked for a week. Any idea when this could get fixed? I don't mean to be a pain but I need to demo my site to a bunch of teachers by the end of the week. If the site works, I will probably move to a paid hosting account with x10. If not, I will have to move the site.

    Thanks

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,635

    Re: PHP Mail Function Still Not Working

    Try this script.
    The From must be an address on your account. It cannot be a hotmail or gmail account.
    PHP Code:

    //  TEST OF THE MAIL SYSTEM USING PHP mail()

    date_default_timezone_set('America/Los_Angeles');
    echo 
    date('l jS \of F Y h:i:s A'); 


    $from "FROM ACCOUNT ON YOUR SITE";
    $to="TO ADDRESS"


    $mailbody="Test message sent (PST): \n" date('l jS \of F Y h:i:s A');
    $subject="Test of PHP mail()" ;

    $headers "Content-type: text/plain; charset=windows-1251 \r\n";
    $headers .= "From: $from\r\n";
    $headers .= "Reply-To: $from\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "X-Mailer: PHP/" phpversion();

    $resp mail($to$subject$mailbody$headers);

    if( 
    $resp ){
        
    $outcome "Mail sent" ;
    } else {
        
    $outcome "Mail not sent";
    }

    print 
    "\nThe mail system said: $outcome\n\n" ;
    exit(); 
    Nothing is always absolutely so.

  3. #3
    dusmar93 is offline x10Hosting Member dusmar93 is an unknown quantity at this point
    Join Date
    Oct 2011
    Posts
    19

    Re: PHP Mail Function Still Not Working

    Ok. I think I got it now. Thank you very much for the script! It was very helpful


    thanks again!

Closed Thread

Similar Threads

  1. Replies: 0
    Last Post: 11-02-2011, 09:46 AM
  2. is php mail() function working?
    By web.houstontoh88 in forum Programming Help
    Replies: 19
    Last Post: 05-06-2011, 08:04 AM
  3. PHP Mail function not working.Please check the mail log
    By vv.bbcc19 in forum Free Hosting
    Replies: 0
    Last Post: 01-15-2011, 12:08 AM
  4. php mail() function not working
    By scholar in forum Free Hosting
    Replies: 3
    Last Post: 10-22-2010, 10:58 PM
  5. Replies: 4
    Last Post: 10-16-2010, 02:01 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