Instructions

How to Use the PHP Form Generator

  1. Download PHPMailer, LICENCE.TXT & README.txt included and unzip it.
  2. Upload the entire unzipped PHPMailer folder (with src/ inside) to the same directory as the contact page is destined for.
  3. Select Fields in the form generator you want in your contact form (Name, Email, Message, etc.)
  4. Enter Your SMTP Settings
  5. Click ‘Generate Form Code’
  6. You’ll see four code blocks:
  7. PHP - this goes above <!DOCTYPE html>
  8. CSS - this goes the the head section.
  9. HTML - this goes in the body section.
  10. JavaScript - this goes just above the </body> closing tag.
  11. Paste them into your contact form page (save as .php with UTF-8 encoding).
  12. Upload the new PHP file to your server and test it.

Custom Email

Use the SMTP details for your custom domain email (from your hosting provider or email service):

  1. SMTP Host: e.g. mail.yourdomain.com
  2. Port: typically 587 (TLS) or 465 (SSL)
  3. Username: full email (e.g. info@yourdomain.com)
  4. Password: your email password
  5. Security: select TLS or SSL as required
  6. From Email: same as your email address
  7. To Email: where form submissions should be sent

Important:

Delivery success is dependent on correct settings: Server MX Records for domain verification and SPF Record for email validation, DKIM, and DMARC, and using secure connections such as TLS / SSL.

Ensure port 587 is open on your server.

Make sure the "From" address matches the SMTP credentials — otherwise, many providers will silently block or reject.

SPF/DKIM/DMARC settings on the domain improve deliverability, especially if you're using a custom domain and trying to send through Gmail or Outlook.

Avoid testing with the same email for both "To" and "From" — it can look suspicious to spam filters.

Best option: Use a professional email service such as Proton Mail or Zoho Mail to guarantee email delivery.

Gmail

  1. SMTP Host: smtp.gmail.com
  2. Port: 587 (TLS) or 465 (SSL)
  3. Security: TLS or SSL
  4. Username: Your full Gmail address
  5. Password: Gmail App Password (not your usual Gmail password — see below)

Important:

  1. Gmail blocks less secure apps by default.
  2. To send mail using SMTP, you must:
  3. Enable 2-Step Verification for the Gmail account.
  4. Generate an App Password via your Google Account under Security > App Passwords.
  5. How to generate a Gmail App Password

Best option: Custom email and use a professional email service such as Proton Mail or Zoho Mail to guarantee email delivery.

Outlook / Hotmail (Microsoft 365)

  1. SMTP Host: smtp.office365.com or smtp-mail.outlook.com
  2. Port: 587 (TLS)
  3. Security: TLS
  4. Username: Your Outlook/Hotmail email
  5. Password: Usually works with your normal password, but may require an App Password if 2FA is enabled.

Outlook sometimes blocks SMTP unless the account is explicitly allowed to send from third-party apps.

Best option: Custom email and use a professional email service such as Proton Mail or Zoho Mail to guarantee email delivery.