Scripts & Templates

PHPMailer

The classic, well-maintained library for sending email from PHP over SMTP with attachments and HTML bodies.

Pass it on: WhatsApp
Added
Oct 27, 2026
Source
github.com

PHPMailer is the go-to library when PHP's built-in mail() function isn't reliable enough. It sends email through a real SMTP server, so messages are far less likely to land in spam.

What you can do with it

  • Send HTML emails with a plain-text fallback
  • Attach files and embed images
  • Log in to Gmail, Microsoft 365 or your host's SMTP with TLS

Good to know

Install it with Composer (composer require phpmailer/phpmailer) or download the source files. It's open source and free for commercial projects.

Was this helpful?