<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>laravel 10 E-Mail send Archives - Codeplaners</title>
	<atom:link href="https://codeplaners.com/tag/laravel-10-e-mail-send/feed/" rel="self" type="application/rss+xml" />
	<link>https://codeplaners.com/tag/laravel-10-e-mail-send/</link>
	<description>Code Solution</description>
	<lastBuildDate>Wed, 01 Jan 2025 06:41:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>

<image>
	<url>https://codeplaners.com/wp-content/uploads/2020/09/cropped-favicon-social-32x32.png</url>
	<title>laravel 10 E-Mail send Archives - Codeplaners</title>
	<link>https://codeplaners.com/tag/laravel-10-e-mail-send/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Laravel 10 E-Mail Send With Attachment</title>
		<link>https://codeplaners.com/laravel-10-e-mail-send-with-attachment/</link>
					<comments>https://codeplaners.com/laravel-10-e-mail-send-with-attachment/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 01 Jun 2024 03:42:22 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Laravel 10]]></category>
		<category><![CDATA[Laravel 8]]></category>
		<category><![CDATA[Laravel 9]]></category>
		<category><![CDATA[laravel 10 E-Mail send]]></category>
		<guid isPermaLink="false">https://codeplaners.com/?p=1543</guid>

					<description><![CDATA[<p>This post was last updated on January 1st, 2025 at 06:41 amHi dev, Today, i show you laravel 10 E-Mail send with attachment. This article will give you simple example of laravel 10 E-Mail send with attachment. you will laravel 10 E-Mail send with attachment. In this article, we will implement a laravel 10 E-Mail &#8230; <a href="https://codeplaners.com/laravel-10-e-mail-send-with-attachment/" class="more-link">Continue reading<span class="screen-reader-text"> "Laravel 10 E-Mail Send With Attachment"</span></a></p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-10-e-mail-send-with-attachment/">Laravel 10 E-Mail Send With Attachment</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="last-modified">This post was last updated on January 1st, 2025 at 06:41 am</p><p>Hi dev,</p>
<p>Today, i show you laravel 10 E-Mail send with attachment. This article will give you simple example of laravel 10 E-Mail send with attachment. you will laravel 10 E-Mail send with attachment. In this article, we will implement a laravel 10 E-Mail send with attachment. </p>
<p>So, let’s follow few steps to create example of laravel 10 E-Mail send with attachment.</p>
<h3 class="step_code">Step 1: Laravel 10 Install</h3>
<p><strong>Follow This Command And Install Laravel</strong></p>
<pre class="brush: php; title: ; notranslate">
composer create-project laravel/laravel example-email
</pre>
<h3 class="step_code">Step 2: Install Package &#038; Config</h3>
<p>First, we need to install barryvdh/laravel-dompdf package. Run this composer command to install the package:</p>
<pre class="brush: php; title: ; notranslate">
composer require barryvdh/laravel-dompdf
</pre>
<p>Now open the .env file and set your SMTP credentials:<br />
<strong>.env</strong></p>
<pre class="brush: php; title: ; notranslate">
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME=&quot;${APP_NAME}&quot;
</pre>
<h3 class="step_code">Step 3: Add Route</h3>
<p><strong>routes/web.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

use App\Http\Controllers\TestController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the &quot;web&quot; middleware group. Now create something great!
|
*/

Route::get('send-email', &#x5B;TestController::class, 'sendMailWithPDF']);
</pre>
<h3 class="step_code">Step 4: Add Controller</h3>
<p><strong>app/Http/Controllers/TestController.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

namespace App\Http\Controllers;

use PDF;
use Mail;

class TestController extends Controller
{
    /**
     * Write code on Method
     *
     * @return response()
     */
    public function sendMailWithPDF()
    {
        $data&#x5B;&quot;email&quot;] = &quot;test@gmail.com&quot;;
        $data&#x5B;&quot;title&quot;] = &quot;Welcome to codeplaners.com&quot;;
        $data&#x5B;&quot;body&quot;] = &quot;This is the email body.&quot;;

        $pdf = PDF::loadView('mail', $data);

        Mail::send('mail', $data, function ($message) use ($data, $pdf) {
            $message-&gt;to($data&#x5B;&quot;email&quot;], $data&#x5B;&quot;email&quot;])
                -&gt;subject($data&#x5B;&quot;title&quot;])
                -&gt;attachData($pdf-&gt;output(), &quot;test.pdf&quot;);
        });

        dd('Email has been sent successfully');
    }
}
</pre>
<h3 class="step_code">Step 5: Add PDF Blade File</h3>
<p><strong>resources/views/mail.blade.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Laravel 10 E-Mail Send With Attachment - codeplaners.com&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;h3&gt;{{ $title }}&lt;/h3&gt;
    &lt;p&gt;{{ $body }}&lt;/p&gt;

    &lt;p&gt;
        Regards,&lt;br/&gt;
        codeplaners.com
    &lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h3 class="step_code">Step 6: Run Laravel:</h3>
<pre class="brush: php; title: ; notranslate">
php artisan serve
</pre>
<p>Now, you have to open the web browser, type the given URL and view the app output:</p>
<pre class="brush: php; title: ; notranslate">
http://localhost:8000/send-email
</pre>
<p>I hope it will assist you…</p>
<p>The post <a rel="nofollow" href="https://codeplaners.com/laravel-10-e-mail-send-with-attachment/">Laravel 10 E-Mail Send With Attachment</a> appeared first on <a rel="nofollow" href="https://codeplaners.com">Codeplaners</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codeplaners.com/laravel-10-e-mail-send-with-attachment/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
