Jump to:

23552 Posts in 19349 Topics by 2891 members

General Questions

SilverStripe Forums » General Questions » Show Image attachment in Email body?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 592 Views
  • Pix
    Avatar
    Community Member
    145 Posts

    Show Image attachment in Email body? Link to this post

    Hi,

    I have a form which sends an e-mail with an image attachment. I was wondering how would I also display the image in the body of the e-mail? I was reading how the src must reference 'cid' or something like that, so I tried:

    <img src="cid: name-of-attachment.jpg" alt="pic">

    But did't work, maybe there is a better way with SilverStripe? The image must be sent as an attachment, it will not live on the server, so I need to reference the src from the email somehow.

    Thank you!

  • Pix
    Avatar
    Community Member
    145 Posts

    Re: Show Image attachment in Email body? Link to this post

    Just kind of wondering about this.....that's all.....

    So, this is good

    $email->attachFile("myImage.jpg");

    but (this doesn't work):

    <img src="myImage.jpg" alt="my image">

    in the email template. How to reference the attached image? Anyone?

    592 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.