
- Forum
- Programming Talk
- ASP
- Send email from asp.net application
Send email from asp.net application
This is a discussion on Send email from asp.net application within the ASP forums, part of the Programming Talk category; Hello, I am having a webpage on which I have a detailsView through which I insert a record in to ...
-
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
-
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.
-
Sponsored Ads

Reply With Quote





