0

I'm using $window.open() to send an e-mail to a specific destination, but I can't send it with an attachment or embedded image.

I have something like this:

$window.open('mailto:xxx@xxx.xx?subject=Subject&body=Body&attachment=http://images0.minutemediacdn.com/production/912x516/57ea81dce8f2a0c893000001.jpg');

Is there any away to solve this and send an e-mail with that picture (embedded or attach)?

Explorer
  • 1,491
  • 4
  • 26
  • 67
kilkus
  • 15
  • 1
  • 8

1 Answers1

2

You can't send an email directly with javascript. You can only open the user's mail client:

window.open('mailto:test@example.com');

There are also some parameters to pre-fill the subject and the body:

window.open('mailto:test@example.com?subject=subject&body=body');
digit
  • 4,479
  • 3
  • 24
  • 43
  • My question is how to pre-fill the attachment. – kilkus Jan 02 '17 at 15:28
  • Sorry you can't . There is no attachment parameter to pre-fill. – digit Jan 02 '17 at 15:32
  • And embedded a picture (using url) in email body? – kilkus Jan 02 '17 at 15:53
  • No. If you have been familiar with javascript, why don't you try out nodejs. It is framework for javascript. Check out this tutorial http://javascript.tutorialhorizon.com/2015/07/02/send-email-node-js-express/ – digit Jan 02 '17 at 23:18