Monday, March 19, 2012

AUtomatic mail alert

HI,

I have to send an automatic e-mail based on database table .Could any body help me

how to write stored procedure and where to execute it.How to send an automatic e-mail through sql server?

Thanks in advance.

Regards,

Raja.

Hi Raja,

To send an email in a stored procedure in SQL Server, you can call xp_sendmail directly.

http://msdn2.microsoft.com/en-us/library/ms189505(SQL.90).aspx

Before this, you have to configure an extended MAPI mail profile. Here is a link for how to do it.

http://msdn2.microsoft.com/en-us/library/ms175189(SQL.90).aspx

However, you can also read data from the database table and do this in your .net application, using the System.Net.Mail.MailMessage class.

http://msdn2.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx

HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!

No comments:

Post a Comment