Posted inProgramming / php

PHPMailer Sending Emails using PHP Code

Today, We want to share with you PHPMailer Sending Emails using PHP Code.In this post we will show you php code to send email using smtp server, hear for Sending Emails in PHP with PHPMailer we will give you demo and example for implement.In this post, we will learn about Sending Emails using PHP with PHPMailer with an example.

PHPMailer Sending Emails using PHP Code

There are the Following The simple About PHPMailer Sending Emails using PHP Code Full Information With Example and source code.

As I will cover this Post with live Working example to develop send mail using phpmailer from localhost, so the send mail using smtp in php example for this example is following below.


SMTPDebug = 2;
    $send_mail->Host = '';
    $send_mail->SMTPAuth = true;
    $send_mail->Username = '[email protected]';
    $send_mail->Password = 'set_here_my_password';
    $send_mail->SMTPSecure = 'tls';
    $send_mail->Port = 587;
    $send_mail->setFrom('', 'Jaydeep');
    $send_mail->addAddress('', 'Pakainfo');
    $send_mail->addReplyTo('', 'noreply');
    //PHP Files Attachments
    $send_mail->Subject = 'Wel-come To & Test Mail Subject!';
    $send_mail->Body    = 'Latest Body of simple Pakainfo is SMTP Email Testing demo';
    echo 'Good Luck Your Message has been sent';
} catch (Exception $e) {
    echo 'Sorry Dear, Message could not be sent.';
    echo 'Mailer Error: ' . $mail->ErrorInfo;

And last You access this web application using any browser like Mozila, chrome or any other with your main domain name following by any script name
Angular 6 CRUD Operations Application Tutorials

Read :


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about PHPMailer Sending Emails using PHP Code.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Leave a Reply

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

We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype