Illuminate\Mail

Estimated reading time: 1 minute

Illuminate\Mail

mail process

  • make:mail WelcomeMailHere
    • http/mail/welcome/WelcomeMailHere.php
      • public variable auto accessable by view
      • pass data by ->with['name'=>$this->user] and access by view $name variable

      •  public $name;
         public __construct($name) {
           $this->name = $name;
         }
         function build(){
           return $this->from('your_company_email')
                       ->subject('subject')
                       ->view('parrot.mails.welcome')
                       ->with(['user'=>$this->name]);
         }
        
  • controller
    use mailNamespace (WelcomeMailHere);
    $data = new WelcomeMailHere($pass_data);
    Mail::to('[email protected]')->send($data)
    
  • blade

      
    
    • configure viewConfig
    • set path realpath(base_path('parrot'))

real server

  • mailchip
  • mailgun
  • sparkpost
  • mailjet
  • amazon ses
  • sendgrid