Email composer with base64 img attachment not working

I'm not a pro programmer but I'm trying to attach a img file using this plugin in a mobile web app.

Now, the plugin says I have to do something like this to add an attachment

attachments:

'base64:icon.png//iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/...'

And my base64 img for example is:

data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJ.......

which is saved in the var imgURI

I've tried to do attachment: "base64:icon.png//" + $rootScope.imgURI.substring(24),

And also without substring or with substring 25, 26. In every case the attachment isn'ìt passed to the email composer. to:, subject:, body:, are working fine.

What am I doing wrong? Can you please help me? Thanks