i tried with below code but its not working for me.
I am send it to gmail.

is there anything which i have missed out?

$subject = "Happy Work Anniversary !" ;
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$link = public_path() . "/images/Work_Anniversary.png" ;
$comment = View::make('EmailNotifications/BirthdayEmail');
mail("abc@gmail.com", $subject, $comment, $headers);

and in view i have used

Hello <?php echo $employee_name; ?>,<br>
<img src='<?php echo $link?>'>
path used is <? echo $link ?>
GS Lab


in gmail, it shows broken link.

3 Years
Discussion Span
Last Post by pritaeas

I tried,
but it gives very diffrent path.
it is of something google's


it gived me "/var/www/ABCD/public/" and i have attached "/images/abc.png"
with is nothing but whole path where my image file is located.


In addition, if you're using Laravel, then you can use the asset() helper:

$link = asset("/images/Work_Anniversary.png");

This will prepend the application url.


Hello cereal,
You are right, am using laravel!

I also tried with your solution

Hello <?php echo $employee_name; ?>,<br>
<img src='<?php echo $link;?>'>
path used is <? echo $link ?>

path used gives me proper path of local host.
but image is not iserting in email.

what are the other changes which am missing?


You cannot access localhost from outside, because it always points to the machine it's on. You can only make this work if the image is on an accessible server, either by IP address or by domain name.

The other way would be to embed the image into the e-mail, for that I suggest you search the forum. There are examples to be found.

Edited by pritaeas

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.