EasyCFM.COM ColdFusion Forums / Coding Help! / How to output file in newsletter

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: How to output file in newsletter

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

tati2001
01-12-2013 @ 6:15 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Member
Posts:
Joined: Dec 2012

Hi,
I have created newsletter but not able to output image fields in the newsletter email.
i want to output the image file name inside newsletter_image within the email.
the image i want to output is located inside newsletter database, newsletter_image field

here what i have now.

<CFQUERY NAME="GetMembers" DATASOURCE="#dbase#">
      select Name,Email
         FROM subscribers_list
          ORDER BY Email
       </CFQUERY>
      
       <CFQUERY NAME="getnewsletters" DATASOURCE="#dbase#">
      select newsletter_subject,newsletter_description,newsletter_image,newsletter_file
         FROM newsletter
          ORDER BY newsletter_subject
       </CFQUERY>
      
      
      <cfmail to="xxx@xxx.xxx" bcc="#Email#"
     From="xxx@xxx.xxx" server="xxx.xxxx.xx" username="xxx" password="xxx" port="25"
     subject="newsletter_subject" type="html" mimeattach="C:\img.jpg" query="Getmembers">
     Dear #Getmembers.Name#

     thank you for joining.
  
    #getnewsletters.newsletter_description#
  


     Best wishes
     TEAM
</cfmail>
<cfoutput>
    <p>Thank you  for registering.
    We have just sent you an email.</p>
</cfoutput>  













waiting kind help !!!
thanks


          

Webmaster
01-14-2013 @ 10:36 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

Display a file inline in a mail message

Specify type="html" in the cfmail tag.

Specify disposition="inline" and a ContentID attribute in
the cfmailparam tag.

Use a src="cid:ContentIDValue" attribute to identify the
content to include in the HTML tag such as the img tag.



Example 1: This view-only example uses the cfmailparamtag
to add a header to a message, attach files, and to return
a receipt to the sender.

<cfmail from = "peter@domain.com" To = "paul@domain.com"
    Subject = "See Important Attachments and Reply">
    <cfmailparam name = "Importance" value = "High">
    Please review the new logo. Tell us what you think.
    <cfmailparam file = "c:\work\readme.txt"
type="text/plain">
    <cfmailparam file = "c:\work\logo.gif"
type="image/gif">
    <cfmailparam name="Disposition-Notification-To"
value="peter@domain.com">
</cfmail>

Example 2: This view-only example displays an image in
the body of an HTML message.

<cfmail type="HTML"
        to = "#form.mailto#"
        from = "#form.mailFrom#"
        subject = "Sample inline image">
    <cfmailparam file="C:\Inetpub\wwwroot\web.gif"
        disposition="inline"
        contentID="image1">
    <p>There should be an image here</p>
    <img src="cid:image1">
    <p>After the picture</p>
</cfmail>

Let me know if you need any additional help.


Pablo Varando
Senior Application Architect
EasyCFM.COM, LLC.

904.483.1457 \\ mobile
webmaster@easycfm.com \\email

\m/ (>.<) \m/
--- rock on ---


Website Designed and Developed by Pablo Varando.