Sending e-mail in Laravel with custom HTML

后端 未结 5 917
死守一世寂寞
死守一世寂寞 2021-01-06 02:01

I need to send e-mails but I already have the HTML generated, I don\'t want to use laravel blade because I need to apply a CSS Inliner to the HTML, so this is how i generate

5条回答
  •  北海茫月
    2021-01-06 02:14

    $data = array( 'email' => 'sample@domail.com', 'first_name' => 'Laravel', 
            'from' => 'sample@domail.comt', 'from_name' => 'learming' );
    
    Mail::send( 'email.welcome', $data, function( $message ) use ($data)
    {
     $message->to( $data['email'] )->from( $data['from'], 
     $data['first_name'] )->subject( 'Welcome!' );
     });
    

提交回复
热议问题