Results 1 to 6 of 6

Thread: PHP Mail() function - need help

  1. #1
    Join Date
    Sep 2006
    Posts
    2

    Question PHP Mail() function - need help

    :confused: I am new to PHP and to Bluehost so any help you can provide will be greatly appricated. Here is my problem, I recently migrated all the source code for my site to Bluehost. Everything except for the mail() works.

    Do I need to modify the php.ini? Do I need to modify the code itself? Please post a sample of the php.ini settings and source code that calls the mail() function. Thanks in advance.

    Source code - I keep getting 'Failed to Send':
    if (mail($to,$subject,$message,$headers,$from)){
    echo "";
    ?>
    <p align=center> <b>Thank you for your interest.
    <p><b>Someone will contact you to discuss your application. </b>
    </b>
    <p><br>
    <br>
    <?php
    }
    else {
    echo "Failed to send";
    }

  2. #2
    Join Date
    Feb 2006
    Posts
    193

    Default

    If you are using the BH DNS(ns1.bluehost...), then check to see that the $from address is an existing email in your BH account.
    (go to your CP /domain manager and use whois info to find that out.)
    or.....
    maybe, you migrated the source code, but did you transfer your domain name to BH, or is it pointing to BH servers (DNS)
    In that case your site is not using the BH mail servers.
    example :your site content could be on BH, but if it is registered somewhere else and the DNS is not ns1.bluehost.com..etc, then your domain might be using url forwarding or framing (to bring visitors to the BH location). but your mail functions may be handled by the registrar's

    hope this is not too confusing
    it is also helpfull if you post your domain name here and others can help figure out as well.
    Everything in moderation

  3. #3
    Join Date
    Sep 2006
    Posts
    2

    Default PHP mail() function not working

    Vegasgwm,

    Thanks once again for replying. The A-Name was set to the bluehost shared IP address, at Network Solutions (the current registra). I updated the DNS as you recommended and had bluehost update the MX records to my current email hosting provider and the mail() function now works -- AWESOME......

    -Mike

  4. #4
    Join Date
    Feb 2006
    Posts
    193

    Default

    Glad you got it fixed. cool ;)
    Everything in moderation

  5. #5

    Default

    Quote Originally Posted by vegasgwm
    If you are using the BH DNS(ns1.bluehost...), then check to see that the $from address is an existing email in your BH account.
    (go to your CP /domain manager and use whois info to find that out.)
    or.....
    maybe, you migrated the source code, but did you transfer your domain name to BH, or is it pointing to BH servers (DNS)
    In that case your site is not using the BH mail servers.
    example :your site content could be on BH, but if it is registered somewhere else and the DNS is not ns1.bluehost.com..etc, then your domain might be using url forwarding or framing (to bring visitors to the BH location). but your mail functions may be handled by the registrar's

    hope this is not too confusing
    it is also helpfull if you post your domain name here and others can help figure out as well.
    Does that mean that I need to setup a real mailbox "noreply@soundevolution.com.au" to use that as a From/Reply address in php generated emails?

  6. #6

    Default

    Well I tried that, and it works for the "From: " header. But my "Return-path: " header in the php generated mails still reveals user@box000.bluehost.com, which I would really prefer to keep out of the emails.

    Any ideas?

Posting Permissions

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