我通过我的节点js应用程序使用Mandrill(Nodemailer)来发送电子邮件。当我发送电子邮件时,图像没有显示出来。图像为base64
编码。
这是我的代码:
var transport = nodemailer.createTransport(mandrillTransport({
auth: {
apiKey: 'mykey'
}
}));
transport.sendMail({
from: 'from@gmail.com',
to: 'me@gmail.com',
cc: '',
bcc: '',
subject: 'Email with Images',
html: '<img src="cid:logocid">',
images: [{
'type': "image/png",
'name': 'logocid',
'content': 'R0lGODdhCgAKAHcAACH5BAUAAAEALAAAAAAKAAoAgGNlYwAAAAIRRB6Gq9edEHxM1mVz1FPvUAAAOw=='
}]
}, function(error, response){
if(error){
console.log(error);
}else{
console.log("Message sent: " + response.message);
}
transport.close();
});
以下是我要在电子邮件中显示的base64
图片:
data:image/gif;base64,R0lGODdhCgAKAHcAACH5BAUAAAEALAAAAAAKAAoAgGNlYwAAAAIRRB6Gq9edEHxM1mVz1FPvUAAAOw==