I get this error:

Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in e:\web\www\ptr\register.php on line 46

I'm running my own server, and I do have a mailserver setup, but I could have done it wrong. Here is the mail(); code:

mail("$_POST[user_email]","Registration Info for xxxxx services","Please click on this link to complete your registration (you might have to copy it into your browser's location bar!):\n\nhttp://www.xxxxx.us/register/register.php?a=reg&b=$hash_number$out&c=$_POST[user_email]\n\n-PFP Team","From: Reg Services <register@xxxxx.us>\r\n")

    [font=arial]This:[/font]

    $_POST[user_email]
    

    [font=arial]Should be this:[/font]

    $_POST['user_email']
    

    [J]ona

      I don't think that's the problem - I've used that format all over my script and it works fine.

      Anyways, when I change it, I get this error:

      Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in e:\web\www\ptr\register.php on line 46

        Originally posted by akido
        I don't think that's the problem - I've used that format all over my script and it works fine.

        [font=arial]It shouldn't work at all. Because user_email is not a string variable. If the form element was named, "user_email" you should have it in quotes of some kind. You might want to double-check to make sure that you've added the single quotes around user_email in all of them, then test it.[/font]

        [J]ona

          I tested this program on an external server, and it ran just fine, sent the e-mail with no errors, so that's why I think its a config problem.

          but ill check on what u are talking about

            Originally posted by akido
            I tested this program on an external server, and it ran just fine, sent the e-mail with no errors, so that's why I think its a config problem.

            [font=arial]If it worked previously, then it probably is a configuration problem... Might wanna check your php.ini file on your server and its configurations, and set it up to be just like the one that worked on the external server.[/font]

            [J]ona

              Write a Reply...