[英]How to send images and hyper links via smtpjs?
I have the following code:我有以下代码:
const input = document.querySelector('input')
btn.addEventListener('click',() => {
Email.send({
Host: 'smtp.gmail.com',
Username:'',
Password:'',
To:input.value,
Subject:"",
From: '',
Body:''
}).then(msg=>console.log(msg))
And in the body I want to send a photo, on the next row text and then a hyperlink(or even the button) Is it possible or smtpjs does not provide that functuonality?在正文中我想发送一张照片,在下一行文本上,然后是一个超链接(甚至是按钮)是否有可能或 smtpjs 不提供该功能? Couldn't find anything Or maybe there is another source(not smtpjs), where I could write a template of the letter and then send it
找不到任何东西或者也许有另一个来源(不是 smtpjs),我可以在其中写信的模板然后发送
To send the files, you can define the attachment.要发送文件,您可以定义附件。
Email.send({
SecureToken : "<your security token>",
To : '<whom you want to send>',
From : "<Your email id registered on SMTPJS>",
Subject: "<Subject>",
Body: "<Body Content>",
Attachments:
[{
name: "File_Name_with_Extension",
path: "Full Path of the file"
}]
})
.then(function (message) {
//
}
Next, if you want to send the hyperlink, I think you can use the html content on body instead of text.接下来,如果要发送超链接,我认为您可以在正文上使用 html 内容而不是文本。
...
Body: "Click <a href='[full_path of link]'>here</a> <button>Button</button>",
...
But the onClick event or other javascript actions will not work for button.但是 onClick 事件或其他 javascript 操作不适用于按钮。
Thank you谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.