Free Sending Emails with PHP


Email has become one of the integral part of our daily process in recent years. Especially to business or corporate houses, emails are widely used for communication and marketing purposes.

In this article, we are going to learn to send emails using PHP. We will be using the service of Sendinblue API to send email. We are provided with 300 emails quota per day in free plan.

First, we need to register an account in and get an API key.

1. Download Mailin.php library

Import Mailin.php from here

2. Source Code for index.php


use Sendinblue\Mailin;
$api_key = '**********';

$from_email = '*****';
$from_name = 'Name of Sender';

$to_email = '******';
$to_name = 'Name of Receiver';
$subject = 'This is the subject';
$message = '<h2>Heading 2</h2><p>Here goes the paragraph blah blah blah</p>';

$mailin = new Mailin('',$api_key);
$data = array( 
  "to" => array($to_email=>$to_name),
  "from" => array($from_email,$from_name),
  "subject" => $subject,
  "html" => $message,
  "attachment" => array()

$response = $mailin->send_email($data);
if(isset($response['code']) && $response['code']=='success'){
  echo 'Email Sent';
  echo 'Email not sent';


Follow this video for complete guidance :

ALSO READ  PHP Script to Create Your Own Captcha

Comments are closed.