Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Sendgrid using laravel 4.x

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 214
    Comment on it

    Laravel 4.x provide n number of sending email library such as mandrill,sendgrid etc. These all library are used to send bulk email. To use Sendgrid in our Laravel project we have to follow few steps. By this way we can implement Sendgrid in our Laravel project. The steps are:


    Step 1:

    First create a sendgrid account. To sign up with sendgrid follow the below link:


    Step 2:

    In second step we will set the configuration setting. For setting configuration setting we have to go to the

    app/config/mail.php and In app/config/mail.php you need to configure these settings:

    return array(
      'driver' => 'smtp',
      'host' => '',
      'port' => 587,
      'from' => array('address' => '', 'name' => 'John Smith'),
      'encryption' => 'tls',
      'username' => 'sendgrid_username',
      'password' => 'sendgrid_password',

    In this we have to just mention the sendgrid username and password.


    Step 3:

    Now just use Laravel mail class and all mail will send through SendGrid. The syntax for sending mail is:

    Mail::send('emails.demo', $data, function($message)
        $message->to('', 'Ankit  Bhatia')->subject('This is a demo!');

    In the above example instead of demo just send the email template name which you have created and in data section send the data which you want to send in your mail section.

    By this way we can send mail using SendGrid using laravel 4.x framework.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: