0

I want to embed an image in the mail body using javascript and jquery:

function SendEmail(StudyMail) {
     var emailBodyContent = "<span> " + greating + "</span> ,\n\n";
     emailBodyContent += " <img src=\"images/1.png\" />";
      DivMailBody.html(emailBodyContent);

        var body = DivMailBody.text();

        var contents = "".concat('mailto:' + StudyMail, '?subject= A new study', '&body=', encodeURIComponent(body));

        var pwin = window.open(contents, "_blank", "toolbar=yes, scrollbars=no, resizable=no, width=100, height=100");
        try {
            setTimeout(function () {
                pwin.close();
            }, 100);
        } catch (e) {
        }
}

it sends the mail without the image.

Shaya Ulman
  • 1,299
  • 1
  • 12
  • 24
Ahmed Ramadan
  • 35
  • 1
  • 6

1 Answers1

0

You must you image tag like below and emmbed your image inside your html page

<img src=\"cid:filename\">

for embedding image you can use the following linke

embedding image in html email