I use nodemailer to send mail with a embedded picture,
var mailOption = {
html: 'Embedded image: <img src="cid:unique@kreata.ee"/>',
attachments: [{
filename: 'image.jpg',
content: '/9j/4AA ... Q==',
encoding: 'base64',
cid: 'unique@kreata.ee'
}]
from: '...',
to: '...',
subject: '...'
}
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport();
transporter.sendMail(mail, function(error, info) {
...
});
I can recieved the mail from Outlook, However the picture cannot show in Outlook. I have 2 question,
Take a look at the message in Outlook and check if the PR_ATTACH_CONTENT_ID property is really set to "unique@kreata.ee" and the HTML body (PR_HTML property) references the image using the specified cid. You can see the data in Outlook using OutlookSpy: select the message, click IMessage button on the OutlookSpy toolbar. To see the attachment properties, go to the GetAttachmentTable tab and double click on the attachment.
I find the reason of Problem. the module 'nodemailer' I download and installed is the version 0.6.x which have some issue of attachments. ( I haven't check the reason)
After reinstall the version 1.2.x, the attachment works fine.