Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show an image when using cfmail?

I'm trying to show an image when sending an email. Sending the email works, but in the image it shows blank. I know the 'src' URL is correct because I have it in other places and it shows. How can I get it to work when sending an email?

<CFMAIL TO="email"
        FROM="email"
        SUBJECT="test"
        TYPE="HTML">
        <table>
        <tr><img src="icon_star.gif" alt="star" width="10" height="10">
            <td valign="top" ><font face="Arial, Helvetica, sans-serif" size="2">   <strong>Rising Star Award: #risingstar#</strong></font></td>
            <td valign="top" ><font face="Arial, Helvetica, sans-serif" size="2"><strong>#risingstar_ave#</strong></font></td>
        </tr>
        ....more code ...
like image 992
user3591637 Avatar asked May 28 '26 21:05

user3591637


2 Answers

Your image needs to be available via a full url.

<img src="http://www.MyDomain.com/images/icon_star.gif" 
    alt="star" 
    width="10" 
    height="10">
like image 182
Evik James Avatar answered May 31 '26 12:05

Evik James


you'll need an absolute path to the file so it can find it when the person opens their email.

example:

<img src="http://monkeysite.com/icon_star.gif" alt="star" width="10" height="10">
like image 44
Frank Tudor Avatar answered May 31 '26 12:05

Frank Tudor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!