To the PHP gurus out there, i know someone can help me out.. I currently have a php mailform on my site but when you fill out the form, the information is not reaching the email address specified below. Here is the code and i hope someone can help me straighten out this problem. Also, if i change the email address to an email address hosted in a different company, it works. Is there something that needs to be configured on the mail server to make these php mailform work? <?php $msg = "Name:\t$_POST[name]\n"; $msg .= "Position:\t$_POST[position]\n"; $msg .= "Email :\t$_POST
your headers are wrong. iirc, there's no title header. here's how i would do it. also, you need to quote your array keys. <?php $to = "tatainaemail@mywebsite.com"; $subject = "webmail from website"; $msg = "Name:\t".$_POST['name']."\n"; $msg .= "Position:\t".$_POST['position']."\n"; $msg .= "Email :\t".$_POST['emai'l]."\n\n"; $headers = "From: me@mywebsite.com\r\nX-Mailer: php"; if (mail($to, $subject, $msg, $headers)) { echo("sent"); } else { echo("failed"); } ?> PHP:
Thanks ansi. I made the corrections...but still not working. What confuses me is that....why is it working on my other hosting account.....and not on the other one?
could be the configuration of the mail server i'm not sure. might want to contact the server administrator and find out. if anything i can host you for a small price