php (35) javascript (31) phpjavascript (30) jquery (23) html (20) mysql (14) database (9) codeigniter (4) json (4) bar chart (2) calendar (2) column chart (2) framework (2) google maps (2) query (2) tables (2) url (2) dropdown (1)

Wednesday, March 14, 2018

How To Send Free Outlook Mail Using PHP?

In this tutorial, we are talking about how to send mail using outlook mail service by Simple Mail Transfer Protocol(SMTP).

An SMTP server is a machine that takes care of the whole email delivery process: that's why to send your messages with an email client or software you need first of all to configure the correct SMTP settings.

We are going to use PHPMailer class for sending emails. It’s an easily usable PHP library for sending emails. This class is included in the Download File.

Download PHPMailer form the below link

Create a new file send.php and place the following code into it as per the instructions.

Include PHPMailer class first



This configuration contains account information, Recipient address with name and the message details.

$msg="<strong>This is the test message</strong>"; 
$subject="Test message";

Create the Class object and append the settings of the SMTP server

$mail = new PHPMailer();
$mail->CharSet = 'UTF-8';
$mail->Host = "";
$mail->SMTPAuth= true;
$mail->Port = 587;
$mail->Username= $account;
$mail->Password= $password;
$mail->SMTPSecure = 'tls';
$mail->From = $from;
$mail->FromName= $from_name;
$mail->Subject = $subject;
$mail->Body = $msg;

Error check

Then, check if the mail sends without any errors. If there is an error, it will print out the error

 echo "Mailer Error: " . $mail->ErrorInfo;
 echo "E-Mail has been sent";

If there is any problem or error you are getting on this, please comment below we will try to help.


  1. Your blog is very nice thanks to share. Then justRery nice, thanks share with us Enjoy every bit of your blog. Really look forward to read more. Tech New UK Gat Latest News:hotmail account
    hotmail login

  2. Are your looking for someone to write your assignment, here are expert Assignment help well efficient and capable of creating unique assignments for college or university students all across the globe.

  3. Welcome to the Best writer Review, Here you can get the best All Assignment Help reviews sites. We strongly urge you to check our entire website once and we will assure you will find this review website very useful. Our hard work will be rewarded if students like you will appreciate our effort and spread the message about this site with your class-fellows and friends.

  4. Now its very easy for developer if any developer wants guide lines then follow this blog if he wants to more info then check it

  5. Thank you so much for sharing these amazing tips. Digital Signature Certificate

  6. Thanks very nice share this concept is a good way to enhance the knowledge. Digital Signature Certificate

  7. Thanks very nice share this concept is a good way to enhance the knowledge. Class 2 Digital Signature Certificate

  8. Thanks for the helpful article, it gives me a lot of good information:
    Ngày nay, kinh tế ngày càng phát triển kéo theo những dịch vụ như: vận chuyển ô tô giá rẻ, dịch vụ bốc xếp, dịch vụ ship cod, vận chuyển xe máy bắc nam, cho thuê xe tải, vận chuyển container,... Củng phát triển và hoạt động mạnh mẽ. Proship là một trong những đơn vị cung cấp những dịch vụ nói trên với chất lượng uy tín, giá cả cạnh tranh và thời gian nhanh chóng.


More Posts