How to send SMTP email using PHP

It's only fair to share...Share on Facebook0Share on Google+0Tweet about this on Twitter0Share on LinkedIn0Pin on Pinterest1Digg thisShare on StumbleUpon1

In this tutorial we are using PHP Mailer library (Download latest version from Github) to send SMTP email. This tutorial is basically for PHP beginners. Before using this script you must have SMTP server, user name, password and port. These detail you can get from your IT Team. In this PHP code we are sending HTML format email to 2 recipients. If you want to set CC and BCC then use addCC and adBCC functions as mentioned.

SMTP Configuration File (config.php)

 PHP Code :



Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">