Hi guys and girls,
I am trying to make email based on HTML and inline images using sendMail…but I cant seem to find any documentation about and I am clueless on how to do this.
I am using Servoy 3.5.7.
Thankx in advance
Hi guys and girls,
I am trying to make email based on HTML and inline images using sendMail…but I cant seem to find any documentation about and I am clueless on how to do this.
I am using Servoy 3.5.7.
Thankx in advance
Hi Paolo,
You can off course do it using HTML and having the images online somewhere, but if you don’t want that (and I know you don’t), then you can also include the images as an attachment and embed them in the mail using the following code:
var attachment1 = plugins.mail.createBinaryAttachment('embeddedImage',plugins.file.readFile('c:/nok.jpg'));
var msgText = 'plain msg<html>styled msg<img src="%%embeddedImage%%"></html>';
var success = plugins.mail.sendMail('tsfdfsf@gmail.com', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'unnamed@example.com',[attachment1]);
application.output(success)
Have fun! Don’t spam.