I am having the hardest time to get a simple sendmail.php to work.
My form html is
<form action=sendmail.php id=contact-form method=post>
<p>
<label for=cf_name>Name *</label>
<input id=cf_name name=cf_name placeholder='Enter your name...' required=required title=Name type=text />
</p>
<p>
<label for=cf_email>Email *</label>
<input id=cf_email name=cf_email placeholder='Email address...' required=required title='Email address' type=email />
</p>
<p>
<label for=cf_subject>Subject *</label>
<input id=cf_subject name=cf_subject placeholder='Specify subject...' required=required title=Subject type=text />
</p>
<p>
<label for=cf_message>Message *</label>
<textarea id=cf_message name=cf_message placeholder='Message text...' required=required rows=10 title='Message text'></textarea>
</p>
<p>
<input type=submit value='Send message'/>
</p>
</form>
And my mailer script is:
<?
$cf_email = $_POST['cf_email'] ;
$cf_message = $_POST['cf_message'] ;
$cf_subject = $_POST['cf_subject'] ;
$cf_name = $_POST['cf_name'] ;
mail( "
[email protected]", $cf_subject, $cf_message, $cf_name, $cf_email );
print "Congratulations your email has been sent";
?>
Just want an email to to go to my email. When it appears in the inbox, the subject they typed is the one that I will see as the subject in my inbox. The from will be their name. The email it came from will be their email And the message inside will be the message they wrote in the form.
Please help.