Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 11 of 11
  1. #1
    Jedi Master
    Bob's Avatar
    Join Date
    Apr 2002
    Posts
    3,138
    DNF$
    49,932
    Bank
    0
    Total DNF$
    49,932
    Donate  

    Need help troubleshooting a PHP mail problem

    The PHP mail() function does not work on my server. I need somebody that is familiar with pHP installations and debugging to help me figure out what is wrong.

    Please give me your price to help.

    Thank you.

    -Bob
    . . .

  2. #2
    Platinum Lifetime Member

    Join Date
    Jun 2003
    Posts
    277
    DNF$
    1,785
    Bank
    0
    Total DNF$
    1,785
    Donate  
    Ill try to help. Can you post your code that isnt working? thx.

  3. #3
    Jedi Master
    Bob's Avatar
    Join Date
    Apr 2002
    Posts
    3,138
    DNF$
    49,932
    Bank
    0
    Total DNF$
    49,932
    Donate  
    The mail function simply does not work. Here is the entire code that I am using:

    <?php
    $recipient = "syates88@hotmail.com";
    $subject = "Test from PHP";
    $message = "Testing mail body";
    mail("$recipient","$subject","$message");
    ?>

    < html>< head>< title>< /title>< /head>
    < body>
    Testing mail via pHP< br>< br>
    recipient: < ?php echo "$recipient"; ?>< br>
    subject: < ?php echo "$subject"; ?>< br>
    message: < ?php echo "$message"; ?>< br>

    < /body>< /html>

    NOTE: I put a space after the html tags so they woudl display correctly here. . .

    I get no errors. The HTML displays fine with no PHP warnings.

    In the php.ini file, the path to sendmail it correctly defined.

    -Bob
    . . .

  4. #4
    Platinum Lifetime Member

    Join Date
    Jul 2002
    Location
    Essex, U.K.
    Posts
    888
    DNF$
    520
    Bank
    0
    Total DNF$
    520
    Donate  
    if you put

    $result = mail("$recipient","$subject","$message");

    what does $result return? true or false?

  5. #5
    Platinum Lifetime Member

    Join Date
    Jul 2002
    Location
    Essex, U.K.
    Posts
    888
    DNF$
    520
    Bank
    0
    Total DNF$
    520
    Donate  
    from php.net comments on the mail() function...

    This is a problem I ran into that really had me stumped for awhile.

    I was using mail() to send messages from a bulletin board I created via a form in order to keep users email addresses private (read no email mining possible). Problem was some people were not getting the messages. After testing on MANY different email accounts I was beginning to get stumped.

    It seems that some ISP's and servers require that the Return-Path header email address match the From email address in order for it to be passed onto the users account. By adding

    -f email@address.com

    as the last parameter in the mail function to the same as the From address everything started getting recieved as it should. Here's two examples.

    mail($to, $subject, $body, $from);

    resulted in some people not receiving the message.

    but...

    mail($to, $subject, $body, $from, "-f $from_email_address");

    everyone got the message as intended.

    Hope this helps someone else out as it had me totally baffled until I started comparing the full headers of my email messages.
    perhaps this is the cause of your problems...

  6. #6
    Jedi Master
    Bob's Avatar
    Join Date
    Apr 2002
    Posts
    3,138
    DNF$
    49,932
    Bank
    0
    Total DNF$
    49,932
    Donate  
    Originally posted by Ciqala
    if you put

    $result = mail("$recipient","$subject","$message");

    what does $result return? true or false?
    Ciq: I tried that previously and it was not returning ANYTHING..

    At any rate, the problem was SOLVED.

    The path to sendmail in the php.ini file was /usr/sbin/sendmail.

    Apparantly, it needed the -t -i switches. All is good in mailville now

    -Bob
    . . .

  7. #7
    Platinum Lifetime Member

    Join Date
    Jul 2002
    Location
    Essex, U.K.
    Posts
    888
    DNF$
    520
    Bank
    0
    Total DNF$
    520
    Donate  
    cool 8)

  8. #8
    Platinum Lifetime Member

    Join Date
    Jun 2003
    Posts
    277
    DNF$
    1,785
    Bank
    0
    Total DNF$
    1,785
    Donate  
    you dont have a $from variable..?

  9. #9
    Gold Lifetime Member

    Join Date
    Nov 2011
    Location
    NY
    Posts
    2
    Country

    United States
    DNF$
    372
    Bank
    0
    Total DNF$
    372
    Donate  
    I am also having some issues with my PHP mail from and tried this solution but had no luck. Wondering if you could help?

  10. #10
    Gold Lifetime Member

    Join Date
    Nov 2011
    Posts
    8
    Country

    Philippines
    DNF$
    302
    Bank
    0
    Total DNF$
    302
    Donate  
    We can help you in that. Could you give me your contact information so we can talk about it easily. Hoping to hear from you!

    Regards,
    Bernadette

  11. #11
    silentg's Avatar
    Join Date
    Feb 2010
    Posts
    2,284
    Country

    Canada
    DNF$
    7,832
    Bank
    0
    Total DNF$
    7,832
    Donate  
    You guys do know that this was a 8 year old thread.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Domain name forum recommended by Domaining.com