First create a php page (e.g. Copy all of email.html; Paste the HTML as the source into the inliner; Copy the HTML output and use this as the email template you send; Sending emails using a marketing service like Mailchimp? You can also customize the returned error messages by the PHP Email Form. The formatted message that you’ll receive in your email will be as an example below: Email: Sender Name From: [email protected] Message: The message text. It’s not required to do it this way, we just moved this configuration at the top in the contact.php since it’s the only configuration setting that requires editing for the default contact form. Download Demo. $headers = array ('From' => $email_from, 'To' => $to, 'Subject' => $email_subject, 'Reply-To' => $email_address); $smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $email_body); You can set it directly from here as $contact->from_name = 'Custom Name'; or other input value with a different name, e.g: $contact->from_name = $_POST['sender_name']; The from_email property is the sender email address. As web development becomes standardized, the Model-View-Controller (MVC) architecture has become more popular. MIME messages look nice but what if the recipient doesn’t have MIME, or has chosen to not to view MIME. PHP Email Form is simple and easy to use PHP script for sending the data submitted by web HTML forms (like contact forms) to your email inbox. So here, I will show you how to use PHPMailer library to send mail using Gmail’s SMTP server. If the honeypot field is filled in, we can confidently reject the form as spam. – Jordan Jul 21 '14 at 15:40 The PHP framework is loaded with flexibility. Step 3. Place this code in your PHP file, inside the mail’s body of PHPMailer code.It will look like $mail->Body = “your HTML template”; You can create your own customized HTML template for email or you can use an Email Builder Tool to create responsive email templates. The to property is the receiving email address of the form. A few simple, but solid patterns for responsive HTML email templates and newsletters. 3. No website should be without a contact form. It is the html code you want to send inside an email. This makes the contact form very efficient. Add data-recaptcha-site-key to your form tag, e.g: 4. $htmlContent = file_get_contents ("email_template.html"); Creating a Simple Contact Form with PHP. Return Value: Returns the hash value of the address parameter, or FALSE on failure.Note: Keep in mind that even if the email was accepted for delivery, it does NOT mean the email is actually sent and received! PHP Email Form requires at last PHP version 5.5 in your hosting server. You can add branded colors and fonts. You can just duplicate the forms/contact.php to a new file and use it as a starting point, e.g: myform.php You also need to set the action property to your new form to the newly created myform.php, e.g: