how to simply send mail in laravel all versions
I have write very simple method to send a mail in /Laravel for all version
you can include in your controller use MAIL;
after that create a function to and pass the request parameter in your function .
html=>mail:
mail is create a mail html file in laravel and status =>7 means .in mail html file have multiple mail so i have target only status =7 html file to send the mail
I have also shared the html code in
Mail::send(['html' => 'mail'],
['status' => 7, 'email'=>$data['email']], function ($message) use ($data) {
$message->to($data['email'])->subject
('Congratulations, New User Type Created Successfully Please verify your Account');
$message->from('admin@gmail.com');
});
The above write the mail code
1-First of all set the mail configration in your env file
2- writte the above code .
3- create html page for give 'html' => 'mail'
4-set form mail and to mail in your write above
5- write the subject to so your heading in your mail
The html file format you can use that
@if($status==7)
<
style="background-color:#EDF0F3">
<table align="center" bgcolor="#EDF0F3" border="0" cellpadding="0" cellspacing="0" style="background-color:#EDF0F3;table-layout:fixed;-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;" width="100%">
<tbody>
<tr>
<td align="center" style="-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;">
<table bgcolor="#FFFFFF" border="0" cellpadding="0" cellspacing="0" style="background-color:#FFFFFF;margin:0 auto;max-width:512px;-webkit-text-size-adjust:100%;mso-table-rspace:0pt;width:inherit;mso-table-lspace:0pt;-ms-text-size-adjust:100%;" width="512">
<tbody>
<tr>
<td bgcolor="#F6F8FA" style="background-color:#F6F8FA;padding:5px 16px 13px;-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;border-bottom:1px solid #ECECEC;">
<table border="0" cellpadding="0" cellspacing="0" style="-webkit-text-size-adjust:100%;mso-table-rspace:0pt;width:100% !important;mso-table-lspace:0pt;-ms-text-size-adjust:100%;min-width:100% !important;" width="100%">
<tbody>
<tr>
<td align="center" style="-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;" valign="middle">
<a href="https://www.jobtiviti.com/" style="cursor:pointer;color:#203479;-webkit-text-size-adjust:100%;display:inline-block;text-decoration:none;-ms-text-size-adjust:100%;" target="_blank"><img alt="Jobtiviti" border="0" src="https://app.jobtiviti.com/logo.png" height="42" style="outline: none; color: rgb(255, 255, 255); text-decoration: none;" class="fr-fic fr-dii"></a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;">
<table border="0" cellpadding="0" cellspacing="0" style="-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;" width="100%">
<tbody>
<tr>
<td style="-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;">
<table border="0" cellpadding="0" cellspacing="0" style="-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;" width="100%">
<tbody>
<tr>
<td style="padding:24px 24px 36px 24px;-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;">
<table border="0" cellpadding="0" cellspacing="0" style="-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;" width="100%">
<tbody>
<tr>
<td align="left" colspan="2" id="qatest-hero-headline" style="-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;">
<p style="margin:0;word-wrap:break-word;color:#4C4C4C;word-break:break-word;font-family:Arial,san-serif,'Open Sans';font-weight:400;-ms-word-break:break-all;font-size:16px;line-height:1.5;overflow-wrap:break-word;">
Hi <strong>{{$name}}</strong>,
</p><br/>
<p style="margin:0;word-wrap:break-word;color:#4C4C4C;word-break:break-word;font-family:Arial,san-serif,'Open Sans';font-weight:400;-ms-word-break:break-all;font-size:16px;line-height:1.5;overflow-wrap:break-word;">
You’re receiving this email because you requested a password reset for your Jobtiviti account.
</p><br/>
<p style="margin:0;word-wrap:break-word;color:#4C4C4C;word-break:break-word;font-family:Arial,san-serif,'Open Sans';font-weight:400;-ms-word-break:break-all;font-size:16px;line-height:1.5;overflow-wrap:break-word;">
Please login using your temporary password: <b> {{$password}} </b>
</p><br/>
<p style="margin:0;word-wrap:break-word;color:#4C4C4C;word-break:break-word;font-family:Arial,san-serif,'Open Sans';font-weight:400;-ms-word-break:break-all;font-size:16px;line-height:1.5;overflow-wrap:break-word;">
Once you login, please change it to your new password. <br>
</p><br/>
</td>
</tr>
<tr>
<td align="left" colspan="2" id="qatest-hero-headline" style="-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;padding-bottom:12px;padding-top:12px;">
<p style="margin:0;word-wrap:break-word;color:#4C4C4C;word-break:break-word;font-family:Arial,san-serif,'Open Sans';font-weight:400;-ms-word-break:break-all;font-size:16px;line-height:1.5;overflow-wrap:break-word;">
Thanks,
</p>
<p style="margin:0;word-wrap:break-word;color:#4C4C4C;word-break:break-word;font-family:Arial,san-serif,'Open Sans';font-weight:400;-ms-word-break:break-all;font-size:16px;line-height:1.5;overflow-wrap:break-word;">
The Jobtiviti Team
</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;">
<table align="center" bgcolor="#EDF0F3" border="0" cellpadding="0" cellspacing="0" style="background-color:#EDF0F3;padding:0 24px;color:#6A6C6D;-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;text-align:center;" width="100%">
<tbody>
<tr>
<td align="center" style="padding:16px 0 0 0;-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;text-align:center;">
<table align="center" border="0" cellpadding="0" cellspacing="0" style="-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;" width="100%">
<tbody>
<tr>
<td align="center" style="padding:0 0 12px 0;-webkit-text-size-adjust:100%;mso-table-rspace:0pt;mso-table-lspace:0pt;-ms-text-size-adjust:100%;text-align:center;">
<p style="margin:0;color:#6A6C6D;font-weight:400;font-family:Arial,san-serif,'Open Sans';font-size:12px;line-height:1.333;">© 2019 Jobtiviti Sdn Bhd.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>
@endif
its is very easy to send the mail the format is html.
how to simply send mail in laravel all versions
Reviewed by Bugs Solutions
on
December 12, 2020
Rating:
hi if you problem for sending mail please connect with me
ReplyDeletethanks write the simple code ---------------------------
ReplyDeletenice code that useful for me---------------
ReplyDeletetyurtu
ReplyDeletevery help full code i impress you
ReplyDelete