我已经有一段时间了。通常自己处理事务,但今天我需要提示。
因此,我的任务是在我的新工作(10万听众)上运行电子邮件广告系列,同时花费最少的预算和很短的通知时间(明天)。我倾向于AWS(Amazon Web Services),因为Amazon SES(简单电子邮件服务)非常便宜,您只需支付使用费用即可。
尝试在命令行上使用AWS开发工具包。我做了一个小脚本,逐行读取地址文件(.txt),然后执行发送邮件命令
#! /bin/bash
file='./test-list.txt'
from='[email protected]'
for line in $(<$file)
do
#send mail
aws ses send-templated-email --source=$from --destination=$line --template 'test' --template-data ""
done
脚本返回了错误信息:
Error parsing parameter '--destination': Expected: '=', received: '@' for input:
To:[email protected]
现在我不是bash的王者,但是我尝试了不同的参数公式,但没有任何东西使我摆脱错误。输入文件中的每一行都是正确的电子邮件地址,这看起来像是一个解析问题,但我不明白。
有任何想法吗 ?这将帮助一吨:)
您需要从https://docs.aws.amazon.com/cli/latest/reference/ses/send-templated-email.html#options使用正确的目的地格式
使用示例send-email
:
aws ses send-email --from "example.com" --destination "ToAddresses=${line}" --text "hello world!" --subject "test"
像给出的例子:
aws ses send-templated-email --source $from --destination "ToAddresses=${line}" --template "test" --template-data ""
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句