use App\Mail\FotoAprovada;
use Mail;
try {
$vitrine->save();
$resultado=new Resultado(false,"","Foto aprovada com sucesso.");
// Email
try {
Mail::to($vitrine->email)
->send(new FotoAprovada());
} catch (\Exception $e){
print ' - '.$e->getMessage().PHP_EOL;
}
<html>
<head>
<title>Foto Aprovada</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
</style>
</head>
<body bgcolor="#003366" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td style="text-align:center;">
<img alt="" src="https://XXXX/vitrines/a2bae276qw86e8q6q8we6q8e668qe68qe6e868qw686e2f3df.jpg"/>
</td>
</tr>
</table>
</body>
</html>
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class FotoAprovada extends Mailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->view('emails.fotoaprovada.index')->subject('XXXXXXXX - Foto Aprovada');
}
}
Then as time permits, go through steps https://www.experts-exchange.com/questions/29165628/Sending-Email-by-getting-email-address-from-database.html provides, if running your own in house MTA is required.