2 Replies Latest reply on Nov 5, 2013 8:25 AM by Carl Von Stetten

    Inserting or embed and image into cfmail output from a database-stored path to an actual image.

    College Kid Level 1

      I am trying to insert or embed and image into cfmail from a database-stored path to an actual image. The actual JPEG image is stored in a folder called "images_personnel". The path to the image under the column titled photopath is stored in my database table as "/file/images_personnel/28.jpg". Displaying the image on the screen renders without a problem, embedding the same image as part of a cfloop query does not insert/embed the image into an email. All of the other output of the same cfloop displays and emails just fine. However none of the photos of each personelle show up. What an I doing wrong?

      My code is below:

      <cfquery name="Staffreport" datasource="master">
      Select staffreport.*, name.personnelid, name.email, name.last, name.noiid, stafflt, CONCAT(name.fname,' ',name.middle,' (',name.last,')') AS teammember, CONCAT(name.fname,' ',name.middle) AS teammember2, concat(name.photopath,'',name.photo)as hisphoto, stafflt.*, trim(concat(ltfname,' ',ltmiddle)) as LT from Staffreport, name, stafflt
      where 0=0
      and stalt = '#Session.user_id#'
      and ltid = '#session.user_id#'
      and staweekbegin =
      <cfqueryparam value="#form.staweekbegin#" cfsqltype="cf_sql_date" />
      AND staweekend =
      <cfqueryparam value="#form.staweekend#" cfsqltype="cf_sql_date" />
      AND stapersonnelid = personnelID
      <!---AND ltid = stalt--->
      AND CITY = 'richmond'
      AND STATUS <> 'd'
      AND STATUS <> 'T'
      AND type = 'personnel'
      Group by personnelid
      Order by teammember

      <cfloop query="staffreport"><br />
      <table width="90%" border="0" cellspacing="2" cellpadding="4" align="left">
      <td colspan="2" align="center" valign="top" nowrap="nowrap" bgcolor="cccccc"><strong><font color="black"><cfif #staffreport.last# eq ".">#Ucase(Staffreport.teammember2)# <cfelse>#Ucase(Staffreport.teammember)#</cfif> - ID: <cfoutput>#Staffreport.noiid#</cfoutput></font></strong></td>
      <td align="left" valign="top" nowrap="nowrap" bgcolor="#000000">Name:</td>
      <td bgcolor="E6E1FD">Photo:</td>
      <td bgcolor="EBEBEB">
      <img src="#staffreport.hisphoto#" alt="Photo" width="98" height="98">
      <td bgcolor="E6E1FD">Email:</td>
      <td bgcolor="EBEBEB">#staffreport.email#</td>