How about downloading the CSS file into public/css folder and doing this?
<link href="{{ URL::asset('css/cosmo.css') }}" rel="stylesheet" type="text/css" media="all" />
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi there. This is my first time doing stuff like this, so I'd appreciate some help.
So, anyway. I'm trying to use Bootstrap in an email for my site. The email is just an email for confirming your account, nothing much. But I want it to look nice, like those other sites that somehow use styles in their emails.
Now, here's the problem. I've tried nearly EVERYTHING I can find, but nothing works. By the way, I am using Laravel 5 (the latest version as of about 6 days ago), so I need help finding a solution that will actually work. No, I'm not doing everything wrong, it just doesn't work.
Now, here's my code. Code to send the email
Mail::send('core.emails.auth.confirm', ['user' => $user, 'confirmation' => $confirmation], function($message) use ($email) {
$message->from('noreply@[my domain]')->to($email)->subject('Confirm your GA account');
});
The email view
<!DOCTYPE html>
<html lang="en">
<link href="http://steveville.org/assets/css/cosmo.css" rel="stylesheet" type="text/css" media="all" />
<body style="background-color: #ccc;">
<div class="text-center">
<h1>
[site name]
</h1>
</div>
<hr>
<br />
<div class="maincontent" style="background-color: #FFF; margin: auto; padding: 20px; width: 450px; border-top: 2px solid #27ae60;">
<div class="text-center">
<h1>Dear {{{ $user->name }}},</h1>
<p>Welcome to the [site name] website!</p>
<p>
Someone registered the username <b>{{{ $user->name }}}</b> at <a href="{{{ config('app.url') }}}">{{{ config('app.url') }}}</a> using this email <a href="mailto:{{{ $user->email }}}">{{{ $user->email }}}.
</p>
<p>If this was you, please finish the registration process by confirming your email below.</p>
<p><a class="btn btn-success btn-lg" href="{{{ URL::to('/account/confirm/' . $confirmation->code) }}}"><i class="fa fa-check"></i> CONFIRM E-MAIL</button></p>
<p>If the fancy button does not work, you can copy and paste this link into your browser: <a href="{{{ URL::to('/account/confirm/' . $confirmation->code) }}}">{{{ URL::to('/account/confirm/' . $confirmation->code) }}}</a></p>
<p>If you did not register for our website, please ignore this email.</p>
</div>
</div>
</body>
</html>
The part of the HTML that does not work is the link to the stylesheet. Does anyone know of a way to link to an external stylesheet (CSS file), in an email, with Laravel 5?
Thanks.
If you got confused, just say so and I will explain better.
Please or to participate in this conversation.