Send an image in an email with Grails

后端 未结 3 1950
攒了一身酷
攒了一身酷 2020-12-30 16:28

I am using the Grails mail plugin to send emails and I want to send images in the body of the email, not as attachment. What I want is for images to be shown in the email bo

3条回答
  •  粉色の甜心
    2020-12-30 17:12

    Sorry I don't have enough Stackoverflow points to leave comment on others' answers.

    In @aiolos 's answer, it contains:

    inline 'springsourceInlineImage', 'image/jpg', new File('./web-app/images/springsource.png')
    

    This specifies 'image/jpg' as the output, but the file is in png format. Is this intentional?

    Wikipedia provides a list of mime types: http://en.wikipedia.org/wiki/Internet_media_type#Type_image

    I tried 'image/png' and it worked, so I'm not sure if setting it to 'image/jpg' makes any difference.

提交回复
热议问题