如何使用Google App Engine邮件服务发送电子邮件?

时间:2021-07-23 18:12:02

I want to be able to send emails out from my GAE app. My personal email is registered with the permission "Is Owner" I am using this as the from email following the example on this page. https://cloud.google.com/appengine/docs/java/mail/ I tried sending the email with my application deployed to GAE.

我希望能够从我的GAE应用程序发送电子邮件。我的个人电子邮件注册了“是所有者”权限我在此页面上的示例后使用此电子邮件作为电子邮件。 https://cloud.google.com/appengine/docs/java/mail/我尝试将我的应用程序部署到GAE发送电子邮件。

I get an error message and getting the following exception java.net.SocketException: Permission denied: Attempt to access a blocked recipient without permission.

我收到一条错误消息并获得以下异常java.net.SocketException:Permission denied:尝试在未经许可的情况下访问被阻止的收件人。

I am just trying send a dummy email to test it out.

我只是想发送一个虚拟电子邮件来测试它。

Also if I eventually get this working and I want to use some generic purpose email like admin@mydomain.com, how do I achieve this?

此外,如果我最终得到这个工作,我想使用一些通用目的电子邮件,如admin@mydomain.com,我该如何实现这一目标?

1 个解决方案

#1


The problem is in the recipient's email. You are trying to send to a blocked address (probably something generic like test@example.com). Try changing the recipient's address to something else

问题出在收件人的电子邮件中。您正在尝试发送到阻止的地址(可能是像test@example.com这样的通用名称)。尝试将收件人的地址更改为其他地址

As to your second question, you can only send email from admin emails or addresses ending in: @appid.appspotmail.com

关于您的第二个问题,您只能通过管理员电子邮件或以@ appid.appspotmail.com结尾的地址发送电子邮件

So if you want to send from admin@mydomain.com you should add it to your admins of the apps (of course, the email must be a google account)

因此,如果您想从admin@mydomain.com发送,您应该将其添加到您的应用管理员(当然,电子邮件必须是Google帐户)

#1


The problem is in the recipient's email. You are trying to send to a blocked address (probably something generic like test@example.com). Try changing the recipient's address to something else

问题出在收件人的电子邮件中。您正在尝试发送到阻止的地址(可能是像test@example.com这样的通用名称)。尝试将收件人的地址更改为其他地址

As to your second question, you can only send email from admin emails or addresses ending in: @appid.appspotmail.com

关于您的第二个问题,您只能通过管理员电子邮件或以@ appid.appspotmail.com结尾的地址发送电子邮件

So if you want to send from admin@mydomain.com you should add it to your admins of the apps (of course, the email must be a google account)

因此,如果您想从admin@mydomain.com发送,您应该将其添加到您的应用管理员(当然,电子邮件必须是Google帐户)