The images do not appear in the Mail inbox. Laravel 5.4

Asked

Viewed 102 times

1

There is a contact form where the user sends a message to the system and the system automatically sends a message thanking his contact and along with the message I send the most viewed articles. What happens is that in my Hotmail (in my machine the images appear), but in someone else’s account do not show images of the system type logo nor images of the most viewed articles. How to solve this problem.See how I’m doing. Controller:

$artigo = Postagem::with('departamentos')->where('status', true)->orderByDesc('visualizacao')->paginate($this->paginate);

Mail::send('frontend.email.contato.contato-mensagem' , ['artigos' =>  $artigo , 'contato'   =>  $request] , function($message){
            $message->to($_REQUEST['email']);
            $message->subject('Contatos Igreja de Deus em Luziania');
        });

view:(I will show only the part that matters)

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"
  integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<div class="col-md-12">
    <div class="row" style="margin-top: 40px;">
        <div class="col-md-5 col-md-offset-3">
            <p>Prezado(a) {{$contato->nome}}, queremos agradecer seu contato, sua participação foi muito importante para nós.
                Aproveitamos para reforçar nosso compromisso e lhe atender logo em breve.
                Obrigado.
                <br>
                <a href="{{url('/')}}">Igreja de Deus no Brasil </a> Ainda há lugar.
            </p>
        </div>
    </div>
    <div class="row" style="margin-top: 40px;">
        <div class="col-md-2 col-md-offset-3">
            <h3>Artigos Mais visualizados</h3>
        </div>
    </div>
    @foreach($artigos as $artigo)
        <div class="row" style="margin-top: 40px;">
            <div class="col-md-2 col-md-offset-3">
                <ul class=""><a href="{{url('/')}}/artigos/get/{{$artigo->id}}"
                                class="media-box post-image"><i class="fa fa-angle-right"></i> <img
                                src="{{url('/')}}/imagens/artigo/{{$artigo->imagem}}" alt="" class="img-thumbnail"
                                width="100" height="100"> </a>
                </ul>
            </div>
            <div class="widget-blog-content"><a
                        href="{{url('/')}}/artigos/get/{{$artigo->id}}">{{$artigo->titulo}}</a></div>
            <div class="row">
                <div class="col-md-3">
                    <article>
                        <p>{!! substr($artigo->descricao , 0 ,150) !!} ..</p>
                    </article>
                </div>
            </div>
        </div>
    @endforeach
</div>

In @foreach, it loops the most viewed articles. Now images do not appear. If you’re wrong please tell me what I have to do, because I’m a beginner.

  • I don’t see any <img src="..."> , Are you sure it exists? And the image url is right?

  • The problem may be in the image address, you may be using a URL relative to where the file is you should be wearing a Absolute URL Ex: <img src="//meudominio.com/imgs/teste.png" />

  • In my camera appears the images already in the hot more than another machine does not appear the images. I think the following is happening. On my machine it can access the most localhost server on the other machine can not pq the system and local.

1 answer

1


Inside your src put the image path as the example below:

src="{{ $message->embed(url('/') . '/images/article/' . $article->image)}}"

  • Pv Telles Why did your way work and my way didn’t work? How so This $message came to my view?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.