从sql azure发送电子邮件
大家好,
只是关于 sql azure 的快速问题。我的应用程序在 windows azure 上运行,数据库在 sql azure 上。一切都运转良好。但是,我想在用户成为会员后立即向他/她发送电子邮件。我不想使用
- - third party service
- - send email from the code.
是否有任何方法可以使用触发器和存储过程发送电子邮件?例如:每次更新用户表后运行触发器,触发器将运行存储过程。 提前致谢 。马特
Hey all,
just quick question about sql azure. My App is running on windows azure and the database is on sql azure. Everything is working great. However, I would like to send email to a user, as soon as he\she became a member.I don't want to Use
- - third party service
- - send email from the code.
Is there any way to send email by using a trigger and stored procedure? For example: run trigger after each updated for user table and trigger will run stored procedure.
Thanks in advance . Matt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
据我所知,没有办法直接从 SQL Azure 发送电子邮件。您将必须使用网络、工作者或虚拟机角色来实际发送电子邮件。一般来说,从 Azure 数据中心发送电子邮件很棘手,因为垃圾邮件过滤器会将 Azure IP 地址标记为不安全(请参阅 https ://alinirimie.sys-con.com/node/1404827)。为了避免此问题,您必须使用第三方 SMTP 服务(我们使用 Amazon SES)或您自己的SMTP 服务器。如果要通过防火墙连接到自己的 SMTP 服务器,可以使用 Windows Azure Connect< /a> 建立从 Azure 到本地网络的安全隧道。
As far as I know, there is no way to send an email from SQL Azure directly. You will have to use a web, worker or VM role to actually send email. In general, sending email from Azure data centers is tricky because spam filters flag Azure IP addresses as unsafe (see https://alinirimie.sys-con.com/node/1404827). To avoid this problem, you must use a third party SMTP service (we use Amazon SES) or your own SMTP server. If you want to connect to your own SMTP server through a firewall, you can use Windows Azure Connect to establish a secure tunnel from Azure to your local network.
我知道您说过您不想使用第三方服务,但对于可能正在阅读本文并对此持开放态度的其他人来说。 Cotega 允许您直接从 SQL Azure 发送电子邮件。
完全公开,我在 Cotega 工作。
I realize you stated that you do not want to use a 3rd party services, but for others that might be reading this and would be open to this. Cotega allows you to send emails directly from SQL Azure.
Full disclosure, I work on Cotega.
您可以在此处查看一些有关黑客的文档: http ://vpolizzi.wordpress.com/2010/09/11/database-mail-on-sql-azure/
但是,我认为使用辅助角色会更加健壮和可维护。
There is some documentation on hacks you can do here: http://vpolizzi.wordpress.com/2010/09/11/database-mail-on-sql-azure/
However I think using a worker role would be more robust and maintainable.