Results 1 to 3 of 3

Thread: Is the PHP mail( ) function working? It seems to not for me.

  1. #1
    edudrone is offline x10Hosting Member
    Join Date
    Feb 2012
    Posts
    1

    Is the PHP mail( ) function working? It seems to not for me.

    Hey!
    I used the mail() function in php but am unable to receive any mails on the desired email id.

    Can anyone help me on this?

  2. #2
    lnxx10bz is offline x10Hosting Member
    Join Date
    Jun 2012
    Posts
    53

    Re: Is the PHP mail( ) function working? It seems to not for me.

    They may be blocked by the receiving server. Have you tried sending them to another e-mail address?

  3. #3
    springbox99 is offline x10Hosting Member
    Join Date
    Apr 2011
    Location
    France
    Posts
    33

    Re: Is the PHP mail( ) function working? It seems to not for me.

    It works for me.
    Try this :
    <?php
    // TEST OF THE MAIL SYSTEM USING PHP mail()
    // this must be a valid email account on your domain

    $from = "xxx@xxx.com";

    // DOES NOT BOUNCE BACK FROM hotmail!!

    $to="xxxx@xxx.com";


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

    // NOT text/html
    $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();
    ?>

Similar Threads

  1. Replies: 0
    Last Post: 11-02-2011, 09:46 AM
  2. php mail() function not working
    By t44studio in forum Free Hosting
    Replies: 2
    Last Post: 07-28-2011, 07:30 PM
  3. mail function not working
    By a.jagadees198556 in forum Free Hosting
    Replies: 0
    Last Post: 05-28-2011, 03:08 AM
  4. 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
  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
  •  
dedicated servers