sending email from sql azure

孤街浪徒 提交于 2019-12-10 16:49:03

问题


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


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/5132200/sending-email-from-sql-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!