Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Set Up a Contact Form to Send Email

This guide explains the two ways a website contact form can send email: PHP mail and SMTP. It also shows how to set up each one.

Email2 min read13 steps7 screenshots

What is a contact form?

A contact form is a box on your website. A visitor types a message, clicks send, and you get the message in your inbox. Behind the scenes, your website must send an email for you.

PHP mail and SMTP

PHP is the language many websites are built with. PHP mail is a built-in way to send email straight from the web server. It is quick to set up. But some mail services may mark these emails as spam.

SMTP is the system that carries email from one place to another. Think of it as a post office. With SMTP, your form logs in to a real mailbox and sends the message from there. This is more trusted, so messages usually reach the inbox.

Option 1: Use PHP mail

  1. Open your form settings. In WordPress form plugins, look for Settings or Mail.
    Screenshot: Open your form settings. In WordPress form plugins, look for Settings or Mail .
    Screenshot: Open your form settings. In WordPress form plugins, look for Settings or Mail .
    Screenshot: Open your form settings. In WordPress form plugins, look for Settings or Mail .
  2. Set To to the address that should get the messages.
  3. Set From to an address on your own domain, such as info@yourdomain.com. Do not use a Gmail or Yahoo address here.
  4. Save the form and send a test message.

Option 2: Use SMTP

First, create an email account for your website in cPanel, such as noreply@yourdomain.com. Then connect your form to it.

  1. Find the mail server name, port and login for this mailbox. Your welcome email lists them. In cPanel, open Email Accounts and click Connect Devices next to the account.
  2. In WordPress, install an SMTP plugin such as WP Mail SMTP or Post SMTP.
  3. Open the plugin settings.
  4. Type your mail server name in the SMTP Host box.
    Screenshot: Type your mail server name in the SMTP Host box.
    Screenshot: Type your mail server name in the SMTP Host box.
    Screenshot: Type your mail server name in the SMTP Host box.
    Screenshot: Type your mail server name in the SMTP Host box.
  5. Choose SSL for encryption and port 465, or TLS and port 587. Use the values shown for your account.
  6. Turn on Authentication.
  7. Type the full email address as the username, and the mailbox password.
  8. Set the From Email to the same mailbox.
  9. Save, then use the plugin's Send a test email option.
Tip: If you do not use WordPress, the same values go into whatever mail library your site uses. Ask your developer where the SMTP settings are.

If emails do not arrive

  • Check the spam folder.
  • Check that the password and port are right.
  • Make sure the From address belongs to your domain.

Still stuck? Open a ticket at https://secure.hostvento.com/submitticket.php.

Quick recap

  • A contact form needs a way to send email.
  • PHP mail is simple but may land in spam.
  • SMTP logs in to a real mailbox and is more reliable.
  • Use an address from your own domain as the sender.
  • Always send a test message after saving.