Results 1 to 2 of 2

Thread: Help, Found answer in BlueHost Support Center but still not working (php email form)

  1. #1
    Join Date
    Oct 2006
    Posts
    1

    Default Help, Found answer in BlueHost Support Center but still not working (php email form)

    Hello,

    I have spend about 7 hours trying to get a very simple email form to display the "From" address when I recieve and email form my flash website / php form.

    The form send the email, I get it, but it says <somethingwierd>@40.bluehost.com instead of the email that the person entered in the form.

    I know this is simple, but I even spent 2 hours with Bluehost support and we ended up getting disconnected.

    Here is my issue in the helpdesk:

    http://helpdesk.bluehost.com/kb/inde...od_id=2&id=231

    in the flash (remember, the emails are sending, just not picking up the proper From address):
    submit_btn.onRelease = sendMessage;

    function checkForm():Boolean {
    // this checks whether required fields have been filled in
    // initialize missing flag on assumption everything OK
    var missing:Boolean = false;
    // if missing is true, return false
    // otherwise return true
    return missing ? false : true;
    }
    function sendMessage():Void {
    // check whether form has been correctly filled in
    var formOK:Boolean = true;
    // if no problems, process the form and send variables to PHP script
    if (formOK) {
    // Form processing goes here
    message.from = name_txt.text;
    message.email = email_txt.text;
    message.comments = comments_txt.text;
    message.sendAndLoad("feedback.php?ck="+ new Date().getTime(), messageSent);
    // display message informing user that email is being sent
    }
    }
    // create LoadVars instance to retrieve date from PHP script
    // initialize LoadVars to send form data
    // and receive response from the PHP script
    var message:LoadVars = new LoadVars();
    var messageSent:LoadVars = new LoadVars();
    // load date from PHP
    messageSent.onLoad = function() {
    if (this.sent == "OK") {
    _parent.gotoAndStop(7);
    } else {
    comments.text = "Error calling PHP File!";
    }
    };



    On the Buttons (may not be important)
    name_txt
    email_txt
    comments_txt



    feedback.php file:
    <?php
    // initialize variables for To and Subject fields
    ################################################
    # Replace 'david@example.com' with the address #
    # you want the feedback to be sent to #
    ################################################
    $to = 'mahdi@lienreports.com';
    $subject = 'Nationwide Vanlines Contact';

    // build message body from variables received in the POST array
    $message .= 'From: '.$_POST['from']."\n\n";
    $message .= 'Email: '.$_POST['email']."\n\n";
    $message .= 'Comments: '.$_POST['comments'];

    // add additional email headers for more user-friendly reply
    ##################################################
    # Replace 'Flash feedback<feedback@example.com>' #
    # with an appropriate address for your website #
    ##################################################
    $additionalHeaders = "Reply-To: ".$_POST[email]."\n";

    // send email message
    $OK = mail($to, $subject, $message, $additionalHeaders);
    // let Flash know what the result was
    if ($OK) {
    echo 'sent=OK';
    }
    else {
    echo 'sent=failed&reason='. urlencode('There seems to be a problem with the server. Please try later.');
    }
    ?>


    php.ini file:
    Line 317: [mail function]
    Line 318: SMTP = localhost
    Line 319: sendmail_from = mahdi@lienreports.com
    Line 320: sendmail_path = /usr/sbin/sendmail -t -i


    Thank you.

  2. #2
    Join Date
    Oct 2006
    Posts
    358

    Default

    frequency,

    It looks like your PHP script is not setting a "From" header. See this thread for sample code:

    http://www.bluehostforum.com/showthread.php?t=2712


    Stephen

Posting Permissions

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