简体   繁体   English

Email function 用于 azure postgresql 服务器

[英]Email function for azure postgresql server

How can one write a code in azure postgresql server which can send email.如何在 azure postgresql 服务器中编写可以发送 email 的代码。 As Azure postgresql sever is a fully managed by azure and no option is there for installing extensions apart from limited already available extensions.由于 Azure postgresql 服务器完全由 azure 管理,除了有限的可用扩展之外,没有其他选项可以安装扩展。

You usually shouldn't send emails from the database.您通常不应该从数据库发送电子邮件。 If the email sending becomes slow, you can get cascading locks.如果 email 发送变慢,您可以获得级联锁。 And if it fails, then what should you do?如果它失败了,那你该怎么办? You can store the email to be sent in a table, then have a process written in you favorite language access the table to do the sending.您可以将要发送的 email 存储在一个表中,然后用您喜欢的语言编写一个进程访问该表进行发送。 Or you can set up LISTEN/NOTIFY to do the same thing.或者你可以设置 LISTEN/NOTIFY 来做同样的事情。 Or you could combine them, if you want the transactionality of a separate table but don't want the polling of checking on it periodically.或者,如果您想要单独表的事务性但不希望轮询定期检查它,您可以将它们组合起来。

Another option of course is not to use hosting solutions which prevent you from doing what you want.当然,另一种选择是不使用阻止您做自己想做的事情的托管解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM