I'm having problem using the From in the Header part of mail function. I'm using Yahoo Small Business - Host Service for my website and I've created a feedback form so the user can send an email to me with any questions or comments. The following inputs that I require from the user is First Name, Last Name, Email, Subject, and Comments. After I receive all of those required inputs from the user, I used variables in PHP to extract info from $_POST.
Here's the example of what I did:
$to = '[email protected]';
$subject = 'Hello';
$message = 'Here is my message';
$from = '[email protected]';
mail($to, $subject, $message, "From: $from");
But it won't send the user's email to my email. Then I tried something different by removing "From: $from" from the mail function, and it worked, but I'm not able to reply to the user.
Can anyone tell me what the problem is and how I can fix this?
Here's the example of what I did:
$to = '[email protected]';
$subject = 'Hello';
$message = 'Here is my message';
$from = '[email protected]';
mail($to, $subject, $message, "From: $from");
But it won't send the user's email to my email. Then I tried something different by removing "From: $from" from the mail function, and it worked, but I'm not able to reply to the user.
Can anyone tell me what the problem is and how I can fix this?