Last post Aug 25, 2011 04:01 AM by ahir_bhavesh
Aug 25, 2011 02:16 AM|vchandm23|LINK
I have seen some websites, when registered an email will be sent to your given emailID. Similarly in my application, When a user is registered i want to send an email. Form the view of maintainability and performance -- which way of doing is suggested.
1. Sending email from SQL Server 2008 . When a store proc add a user in a table through trigger can i sent email to the added user.
2. can i send email from IIS. (I reckon this will be slow because once the user is added in database. this has to notify back the IIS server which contains the ASp.NET application. Now a logic has to be written where if the insert is successfull then we
have to generate an email and attach the contents then BOOM !! - This is think will be bit slower.)
I want to know Whether this is a good design ...... ANY ADVICE OR SUGGESSION IS APPRECIATED ........ AM A BEGINNER LEVEL in ARCHITECT .....
Aug 25, 2011 03:54 AM|ahir_bhavesh|LINK
Sending email is a very common task in any web application. In almost every web application (web site), their will atleast be an occassion to send email in any fashion.
The first thing that you need is the SMTP service. SMTP service should be up and running. And you also need to import the namespace, System.Web.Mail. To create a mail object, you need to create an instance of MailMessage.
By using SMTP service you can easily code for Mail.
for more help click on following link.
Aug 25, 2011 03:54 AM|frez|LINK
The database is for data not for sending emails unless it is an automated job. Put the code in your business logic layer, this will be responsible for asking SQL Server to save the data and when this succeeds sending your email.
Aug 25, 2011 04:01 AM|ahir_bhavesh|LINK