PHP Form doesn't send message if the user inputs a gmail address

Status
Not open for further replies.

sambiex1

New Member
Messages
2
Reaction score
0
Points
1
Hello,

I created a simple php script that lets me email whatever a user inputs into my contact form. However for some reason it doesn't send me the email if the user inputs an address with a popular domain (gmail, yahoo, hotmail, etc). Everything else including custom emails work fine.

I shortened my code to as little as possible to get to the part that's causing this problem and here's what I have left of my script

http://pastebin.com/3un5z8hg

The form is located at http://sambie.io/contact
 

bdistler

Well-Known Member
Prime Account
Messages
3,534
Reaction score
196
Points
63
However for some reason it doesn't send me the email if the user inputs...
// send email
mail($admin_email, "$subject", $message, "From: " . $email);

The outgoing mail server is supposed to silently discard spoofed email addresses. If it has done otherwise recently, that was an error. The [ From ] header must be a real email account attached to your hosting account; you can't set it to a user's email address (or to your own external email address). If you need to easily reply to the emails, then set the ReplyTo header (which can be different from the From header)
 
Status
Not open for further replies.
Top