|
|||
|
Send email from asp.net application
Hello,
I am having a webpage on which I have a detailsView through which I insert a record in to the database. I have a stored procedure called on InsertCommand which is used to insert a record in the database. Now my problem is how should I send an email on that insert. I want to send an email when the insert to the database is done. Can you please help me how send an email on insert into the database. Thanks in advance |
| Sponsored Links |
|
|||
|
The first technique deals with requesting a confirmation read receipt. A confirmation read receipt is a special header tag that gets added to the email. When the email client (such as Outlook, Outlook Express, Eudora ) reads the read receipt header, an email is generated and sent back to the sender. If you are using aspNetEmail, a code example for doing something like this is:
[C#] EmailMessage msg = new EmailMessage( "mail.MyCompany.com" ); msg.FromAddress = "me@MyCompany.com"; msg.To = "you@YourCompany.com"; msg.ConfirmRead = true; [Visual Basic] Dim msg As New EmailMessage("mail.MyCompany.com") msg.FromAddress = "me@MyCompany.com" msg.To = "you@YourCompany.com" msg.ConfirmRead = True Although this technique is easy to implement, there are a number of problems with it. First: is that not all email clients support the confirmation read receipt header. Thus, a user may open a your email and read it, but you never get the read receipt email. Second: of those email clients that do support it, most users have it turned off, because this is a technique used by spammers. Again, you will not get the confirmation emails. Third: is that sometimes the user gets presented with a security dialog, stating the sender wants a read receipt. Some receivers view this as an invitation to their privacy, and will decline the dialog, and may unsubscribe from your newsletter. Fourth: The Read Receipt would still need to be checked, and this would require an automated process scanning an inbox or a folder. |
|
|||
|
you did not mention which db server you are using. with ms sql server you can shoot the email right from the stored proc. (check with your dba, he might need to enable the feature). The advantage is that you can call stored proc asynchronously so your page does not have to wait for the insert and email generation and sending.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Creating an ASP.NET 2.0 Application | rjames | ASP | 1 | 01-30-2007 06:35 PM |
| Hiring freshers | hr_Joseph | Freshers Jobs | 0 | 05-26-2005 12:56 PM |
| how to integrate paypal into an asp.net application? | shylesh | Microsoft .NET Tutorials and Articles | 1 | 03-23-2005 03:26 PM |
| Free VB .NET Std Ed. and ASP.NET Develop. Book | sanereddy | Microsoft .NET Tutorials and Articles | 0 | 10-05-2004 12:59 PM |
| Send upto 1GB attachment to any mail | sanereddy | Chit-Chat | 0 | 07-22-2004 09:17 PM |