如何使用Emailoperator在AWS MWAA(Apache Airffore)中发送电子邮件

发布于 2025-01-30 08:22:38 字数 1485 浏览 1 评论 0 原文

我正在与AWS MWAA(Apache Airffore)合作。我想在管道完成后在MWAA发送电子邮件。我设置了以下配置

现在,当我使用电子邮件操作员运行DAG时,它会给我一个错误。

  File "/usr/lib64/python3.7/socket.py", line 707, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/lib64/python3.7/socket.py", line 752, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
[2022-05-19, 11:11:21 UTC] {{local_task_job.py:154}} INFO - Task exited with return code 1
[2022-05-19, 11:11:21 UTC] {{local_task_job.py:264}} INFO - 0 downstream tasks scheduled from follow-on schedule check

然后我将配置更改为

现在给出以下错误,

  File "/usr/lib64/python3.7/smtplib.py", line 642, in auth
    raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (530, b'Must issue a STARTTLS command first')
[2022-05-19, 12:22:39 UTC] {{local_task_job.py:154}} INFO - Task exited with return code 1
[2022-05-19, 12:22:39 UTC] {{local_task_job.py:264}} INFO - 0 downstream tasks scheduled from follow-on schedule check

请您告诉我我在哪里做错了,或者应该如何配置此电子邮件将电子邮件发送到来自任何域的特定电子邮件地址?

I am working with AWS MWAA (Apache Airflow). I want to send an email in MWAA upon completion of my pipeline.I have set the following configuration
enter image description here

Now when I run my dag using an Email Operator, it gives me an error.

  File "/usr/lib64/python3.7/socket.py", line 707, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/lib64/python3.7/socket.py", line 752, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
[2022-05-19, 11:11:21 UTC] {{local_task_job.py:154}} INFO - Task exited with return code 1
[2022-05-19, 11:11:21 UTC] {{local_task_job.py:264}} INFO - 0 downstream tasks scheduled from follow-on schedule check

Then I changed my configuration to
enter image description here

It now gives the following error

  File "/usr/lib64/python3.7/smtplib.py", line 642, in auth
    raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (530, b'Must issue a STARTTLS command first')
[2022-05-19, 12:22:39 UTC] {{local_task_job.py:154}} INFO - Task exited with return code 1
[2022-05-19, 12:22:39 UTC] {{local_task_job.py:264}} INFO - 0 downstream tasks scheduled from follow-on schedule check

Can you please tell me where I am doing wrong or how should I configure this to send an email to a particular email address from any domain?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青芜 2025-02-06 08:22:38

您的SMTP主机变量是电子邮件地址,而不是主机。

它应该是 smtp.gmail.com 不是

您希望您在该屏幕截图中公开共享密码,并且任何人现在都可以使用它。

Your smtp host variable is an email address and not a host.

It should be smtp.gmail.com not [email protected]

You've hopefully also changed your password as you have shared it publicly in that screenshot and anyone could use it now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文