分享一个 JAVASCRIPT(AMAZON SES SDK)发送邮件的方法, 便宜好用!

2022-02-15 14:13:06 +08:00
 yasea

var credentials = { accessKeyId: "AMAZON accessKeyId", secretAccessKey: "secretAccessKey accessKey" }; AWS.config.update(credentials); AWS.config.region = 'ap-southeast-1';
var sesv2 = new AWS.SESV2(); var params = { Content: {
Simple: { Body: { Html: { Data: '邮件内容', Charset: 'UTF-8' } }, Subject: {
Data: '邮件主题',
Charset: 'UTF-8' } } },
Destination: { ToAddresses: ['xxxx 收件人 xxx@qq.com'] }, FromEmailAddress: '发件人 xxxx', FromEmailAddressIdentityArn: '发件人 ARN',
}; sesv2.sendEmail(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response });

1391 次点击
所在节点    程序员
7 条回复
Kasumi20
2022-02-15 16:04:15 +08:00
Uncaught ReferenceError: AWS is not defined
yasea
2022-02-15 16:11:47 +08:00
@Kasumi20 需要引用 amazon 的 JS SDK 文件, 替换 credentials 信息(换成自己的 amazon 帐号内容)
Michelangelono
2022-02-16 08:35:19 +08:00
免费多大额度?
yasea
2022-02-16 09:10:00 +08:00
@Michelangelono
Amazon EC2 中的应用程序发送电子邮件, 每月前 62000 封电子邮件免费,之后每发送 1000 封电子邮件 0.10 USD
damngoto
2022-02-16 10:10:16 +08:00
不如发个链接?
yasea
2022-02-16 10:14:53 +08:00
asdfzxh
173 天前
no such thing as cxy, not defined by some tech or whatever

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/833981

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX