0

Hello,

I am trying to create a space between line yet it does not work. It suppose to go to the next line. Instead of printing space it actually prints the html tag <br>. Any clue how to fix this problem?

$content = "Someone purchase your picture".<br><br>;

foreach ($request->input('pic') as $key => $value) {

    $content .= "$key : $value".<br>;

    }
2
Contributors
5
Replies
15
Views
4 Weeks
Discussion Span
Last Post by diafol
0

Include the tags within the quotes. No need to try and concatenate.

$content = "Someone purchase your picture<br><br>";

Edited by diafol

0

I actually email the result and it actually shows the html code insteading of really spacing.

SettingController.php

   public function SendPicture(Request $request)
   {

    $title = "Picture Purchase";
    //$picture = $request->input('pic');

    $content = "Someone purchase your picture<br><br>";

    foreach ($request->input('pic') as $key => $value) {

        $content .= "$value".".jpg <br>";

        }

    Mail::send('soulfy.email.purchase', ['title' => $title, 'content' => $content], function ($message) //use ($attach)
    {

        $message->from('davy.yg1@gmail.com', 'Admin');

        $message->to(['davy_yg@yahoo.com', 'stokfoto@soulfy.com']);

        //Attach file
        //$message->attach($attach);

        //Add a subject
        $message->subject("Picture Purchase");

    });

    return redirect('home/setting');

}

Result: Picture Purchase

Someone purchase your picture<br><br>Music2.jpg <br>Travel.jpg <br>Basket.jpg <br>

1

You never mentioned a templating engine. Nor email. If sending email via template - the whole point is that you don't include any markup from your model or controller and it all gets created on the fly in the view.

Have a look at this. You can send plain text email or just default html:

https://laravel.com/docs/5.4/mail

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.