How to integrate Mandrill mail server in Laravel

How to integrate Mandrill mail server in Laravel

How to integrate Mandrill mail server in Laravel

In this tutorial, i will tell you how to integrate Mandrill mail server in Laravel.

Its very essential part to send emails in web application. There are some reason why we send emails to our subsribers as notification, newsletters,marketing, adverts etc.

There are so many services available to provide an API for sending emails to users for engagement.

Mandrill is a reliable and secure email infrastructure service and it's very easy to integrate in Laravel application.

Driver Prerequisites

First you will have to install Guzzle HTTP library by running following command :

"guzzlehttp/guzzle": "~5.3|~6.0"

After Guzzle installation, you will have to set driver option in your config/mail.php.

For Mandrill Mail Server you must have API Key to use mandrill service.

If you do not have mandrill account then create first to get API key.

  1. <?php
  2. return array(
  3.     /*
  4.     |--------------------------------------------------------------------------
  5.     | Mail Driver
  6.     |--------------------------------------------------------------------------
  7.     |
  8.     | Laravel supports both SMTP and PHP's "mail" function as drivers for the
  9.     | sending of e-mail. You may specify which one you're using throughout
  10.     | your application here. By default, Laravel is setup for SMTP mail.
  11.     |
  12.     | Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "log"
  13.     |
  14.     */
  15.     'driver' => 'mandrill',
  16.     /*
  17.     |--------------------------------------------------------------------------
  18.     | SMTP Host Address
  19.     |--------------------------------------------------------------------------
  20.     |
  21.     | Here you may provide the host address of the SMTP server used by your
  22.     | applications. A default option is provided that is compatible with
  23.     | the Mailgun mail service which will provide reliable deliveries.
  24.     |
  25.     */
  26.     'host' => 'smtp.mandrillapp.com',
  27.     /*
  28.     |--------------------------------------------------------------------------
  29.     | SMTP Host Port
  30.     |--------------------------------------------------------------------------
  31.     |
  32.     | This is the SMTP port used by your application to deliver e-mails to
  33.     | users of the application. Like the host we have set this value to
  34.     | stay compatible with the Mailgun e-mail application by default.
  35.     |
  36.     */
  37.     'port' => 587,
  38.     /*
  39.     |--------------------------------------------------------------------------
  40.     | Global "From" Address
  41.     |--------------------------------------------------------------------------
  42.     |
  43.     | You may wish for all e-mails sent by your application to be sent from
  44.     | the same address. Here, you may specify a name and address that is
  45.     | used globally for all e-mails that are sent by your application.
  46.     |
  47.     */
  48.     'from' => array('address' => 'from_email_address', 'name' => 'from_name'),
  49.     /*
  50.     |--------------------------------------------------------------------------
  51.     | E-Mail Encryption Protocol
  52.     |--------------------------------------------------------------------------
  53.     |
  54.     | Here you may specify the encryption protocol that should be used when
  55.     | the application send e-mail messages. A sensible default using the
  56.     | transport layer security protocol should provide great security.
  57.     |
  58.     */
  59.     'encryption' => 'tls',
  60.     /*
  61.     |--------------------------------------------------------------------------
  62.     | SMTP Server Username
  63.     |--------------------------------------------------------------------------
  64.     |
  65.     | If your SMTP server requires a username for authentication, you should
  66.     | set it here. This will get used to authenticate with your server on
  67.     | connection. You may also set the "password" value below this one.
  68.     |
  69.     */
  70.     'username' => 'mandrill_login_email',
  71.     /*
  72.     |--------------------------------------------------------------------------
  73.     | SMTP Server Password
  74.     |--------------------------------------------------------------------------
  75.     |
  76.     | Here you may set the password required by your SMTP server to send out
  77.     | messages from your application. This will be given to the server on
  78.     | connection so that the application will be able to send messages.
  79.     |
  80.     */
  81.     'password' => 'mandrill_password',
  82.     /*
  83.     |--------------------------------------------------------------------------
  84.     | Sendmail System Path
  85.     |--------------------------------------------------------------------------
  86.     |
  87.     | When using the "sendmail" driver to send e-mails, we will need to know
  88.     | the path to where Sendmail lives on this server. A default path has
  89.     | been provided here, which will work well on most of your systems.
  90.     |
  91.     */
  92.     'sendmail' => '/usr/sbin/sendmail -bs',
  93.     /*
  94.     |--------------------------------------------------------------------------
  95.     | Mail "Pretend"
  96.     |--------------------------------------------------------------------------
  97.     |
  98.     | When this option is enabled, e-mail will not actually be sent over the
  99.     | web and will instead be written to your application's logs files so
  100.     | you may inspect the message. This is great for local development.
  101.     |
  102.     */
  103.     'pretend' => false,
  104. );

Now set your api key in config/services.php


'mandrill' => [
    'secret' => 'your-mandrill-key',
],

Sending Emails

For testing, you can paste below line of code in your routes.php and check if you are able to send emails or not.

  1. \Mail::send('welcome', [], function ($message){
  2. $message->to('recipient_email_address')->subject('Expertphp.in - Testing mail');
  3. });

Phone: (+91) 8800417876
Noida, 201301
okey metin2 pvp serverler metin2 pvp
ataşehir escort maltepe escort bostancı escort kadıköy escort maltepe escort ataşehir escort tuzla escort pendik escort ümraniye escort kartal escort
pendik escort
izmir escort izmir escort izmir escort izmir escort denizli escort antalya escort antalya escort antalya escort izmir escort izmir escort izmir escort izmir escort izmir escort
antalya escort akseki escort aksu escort alanya escort bayan antalya escort antalya grup escort antalya masöz antalya rus escort antalya sınırsız escort antalya travesti escort bdsm escort beldibi escort bayan belek escort bayan çallı escort bayan çamyuva escort bayan demre escort bayan elmalı escort bayan fethiye escort bayan finike escort bayan göynük escort bayan güllük escort bayan ışıklar escort bayan kaş escort bayan kemer escort bayan konyaaltı altınkum escort bayan konyaaltı arapsuyu escort bayan konyaaltı escort bayan konyaaltı liman escort korkuteli escort bayan kültür escort kundu escort bayan lara escort bayan manavgat escort bayan muratpaşa escort bayan örnekköy escort bayan rus escort bayan serik escort bayan side escort bayan suriyeli escort tekirova escort bayan üniversiteli escort alanya escort mahmutlar escort alanya escort mahmutlar escort alanya escort mahmutlar escort istanbul escort avrupa yakası escort şişli escort topkapı escort istanbul vip escort maslak escort merter escort aksaray escort arnavutköy escort ataköy escort bağcılar escort bahçelievler escort bakırköy escort beşitaş escort beylikdüzü escort beyoğlu escort halkalı escort istanbul sınırsız escort kağıthane escort mecidiyeköy escort nişantaşı escort escort istanbul ataşehir escort beykoz escort çekmeköy escort kadıköy escort maltepe escort pendik escort sancaktepe escort şile escort sultanbeyli escort tuzla escort ümraniye escort üsküdar escort
beylikdüzü escort istanbul escort şişli escort beylikdüzü escort istanbul escort
kocaeli escort izmit escort bayan gebze escort izmit sınırsız escort escort bursa tuzla escort aydınlı escort orhanlı escort bursa escort escort bayan istanbul escort istanbul sınırsız escort istanbul bayan escort izmit escort izmit escort kocaeli escort sisli escort mecidiyekoy escort bursa escort bayan bursa görükle escort maltepe escort goztepe escort yakacik-yeni-escort bursa sınırsız escort sisli escort bayan taksim escort bursa escort porno izle sikiş izle atasehir escort antalya escort
ankara escort marmaris escort bursa escort mersin escort antalya escort izmir escort samsun escort bodrum escort çeşme escort kuşadası escort adana escort eskişehir escort gaziantep escort esenyurt escort pendik escort tuzla escort fatih escort ümraniye escort mecidiyeköy escort kartal escort bahçelievler escort bahçeşehir escort ataşehir escort bakırköy escort nişantaşı escort avcılar escort büyükçekmece escort kurtkoy escort konya escort beşiktaş escort taksim escort beylikdüzü escort malatya escort sakarya escort şişli escort maltepe escort kadıköy escort ataköy escort bostancı escort şirinevler escort bağcılar escort üsküdar escort etiler escort başaksehir escort ortaköy escort kağıthane escort sultangazi escort halkalı escort çekmeköy escort şaşkınbakkal escort mamak escort sincan escort keçiören escort çankaya escort beypazarı escort akyurt escort pursaklar escort kahramankazan escort göztepe escort alsancak escort bornova escort buca escort karabaglar escort karşıyaka escort konak escort narlıdere escort izmit escort başiskele escort kandira escort körfez escort karamürsel escort dilovası escort gölcük escort gebze escort kocaeli escort kayseri escort elazığ escort denizli escort diyarbakir escort adana escort ankara escort izmir escort antalya escort gaziantep escort kayseri escort konya escort mersin escort denizli escort kocaeli escort diyarbakır escort alanya escort manavgat escort bursa escort eskişehir escort sakarya escort samsun escort malatya escort trabzon escort adıyaman escort afyon escort ağrı escort aksaray escort amasya escort ardahan escort artvin escort aydın escort balikesir escort bartın escort batman escort bayburt escort bilecik escort bingöl escort bitlis escort bolu escort burdur escort çanakkale escort çankırı escort çorum escort düzce escort edirne escort elazığ escort erzincan escort erzurum escort giresun escort gümüşhane escort hatay escort ığdır escort ısparta escort maraş escort karabük escort karaman escort kars escort kastamonu escort kilis escort kırıkkale escort kırklareli escort kırşehir escort kütahya escort manisa escort mardin escort muğla escort muş escort nevşehir escort niğde escort ordu escort osmaniye escort rize escort urfa escort siirt escort sinop escort şırnak escort sivas escort ordu escort tokat escort tunceli escort usak escort van escort yalova escort yozgat escort zonguldak escort kıbrıs escort
adana escort ankara escort bursa escort diyarbakir escort eskisehir escort kayseri escort kocaeli escort konya escort malatya escort maras escort mersin escort ordu escort sakarya escort samsun escort hatay escort mardin escort tekirdag escort antalya escort aydin escort nigde escort nevsehir escort elazig escort manisa escort osmaniye escort denizli escort mugla escort
bedava bahis
tahmin
ankara escort - ankara escort
ataşehir escort ataşehir anadolu yakası escort ankara escort antalya escort antalya escort

flynta 5 mg

flynta 5 mg fiyat

orcafil 5 mg

lifta

degra

sildegra

combo 100 mg

degra 100 mg

vigrande

sinegra

jeligra

lifta 20

vigrande 100 mg

lifta 20 mg

lifta 5 mg

sildegra 100 mg

vigaroo

flynta 20 mg

viagra 100 mg fiyat

orijinal viagra

viagra 100 mg

eczane viagra

viagra sipariş

viagra satın al

viagra nedir

viagra yorum

viagra fiyat

viagra fiyatı 2021

cialis

cialis fiyat

cialis 20 mg

cialis 100 mg

cialis nedir

cialis 5 mg fiyatı

cialis hap

cialis 5 mg

cialis 20 mg eczane fiyatı

cialis 100 mg fiyat

cialis satış

izmir escort
ataşehir escort
pendik aktar