Can you fire a mailto: href from VB.NET code behind. I can create it, assign the email, just cant get it to fire automatically without a client click

I am trying to fire a mailto href in the code behind file, so that once the database update is finished it pulles up an email client window with the Email address populated.  The click event of the button drives thedb update, and then I do not want another click from my user, but to fire the mailto href automatically.  Below is my code.  What renders the href?  Would I do response.write or something to get it to fire???  Help please.  Thanks.  Below is my code which is golden up till firing the html anchor.
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
        Dim strLeadID As String = Request.QueryString("LeadID")
        Dim datDate As Date = Now()
        Dim DBCon As SqlConnection = New SqlConnection()
        Dim Command As SqlCommand = New SqlCommand()
        Dim LeadCaller As DropDownList = form1.FindControl("WebPartManager1$gwptblformatting$frmAppBorInfo$ddLeadCallers")
        Dim strCallerID = LeadCaller.SelectedValue
        DBCon.ConnectionString = ConfigurationManager.ConnectionStrings("VACRMDEVConnectionString").ConnectionString
        Command.CommandText = _
        "Insert Into ConvLog LeadID = " + strLeadID + ", Conversation = 3, Result = 1, NoteDate = " + datDate + ""
        Command.CommandType = CommandType.Text
        Command.Connection = DBCon
        'MsgBox("Here Dude")
        Dim Address As TextBox = form1.FindControl("WebPartManager1$gwptblformatting$frmAppBorInfo$Email")
        Dim strEmail As String = Address.Text
        Dim anch As New HtmlAnchor
        anch.HRef = "mailto:" + strEmail + ""
    End Sub

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is Outlook the one prompting for your acceptance to sent the email?
Outlook has a security 'feature' recently updated to prevent unauthorized use of your account.
OnClick is a product I have used to overcome it..
wolfcoopAuthor Commented:
No.  I dont get a window at all.  First it was just an image that fired off a mailto hyperlkink from a list of leads.  Now my boss wants me to update the database before I fire off the email window.  My code executes, does the database update, and creates the mailto hyperlink, I just want to fire it automatically so that it appears to the end user that they have just clicked a mailto hyperlink.  In other words it pulls up the outlook new message window, with the email address pre-populated.  I just need to or htmlanchor.execute or some way to execute the mailto hyperlink from the code behind file.  I know this is executing on the server, so can I do a response.write"execute hyperlink" or am I just barking up the wrong tree.  I changed my image to an image button so I would have the onclick event available.  Is their an easier way to fire off an outlook email?
Göran AnderssonCommented:
If you would use a hyperlink, then you would have to put it in the page, and then add some Javascript to the page that would simulate a click on the link...

Skip the hyperlink and just redirect to the url:

Response.Redirect("mailto:" + strEmail)
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

wolfcoopAuthor Commented:
tried that, but I do not want to leave the page clicked on.  I know the solution, its just have to import.

Imports System.Web.Mail

and create it and send it from the server.  lol.  Thats the easiest way to handle it, and then I can actually log whethr the user actuall sends the email from server logs.  thanks for your help though.  thought thiswas going to be easy.  It never is.  lol.  Thanks again.
Göran AnderssonCommented:
I thought that you wanted the mail to be sent by the mail program, so that the user could write something in it or attach something to it. That was what you specifically asked for, otherwise I would of course suggested sending it from the server...
wolfcoopAuthor Commented:
I do, and now I had not thought that through.  Was eating dinner.  I do need the user to be able to type the body, etc.  So I can either trap that info in a web form input boxes, or dink with this some more, which I will do.  If I can target a new window with response.redirect that would solve it.
Göran AnderssonCommented:
> If I can target a new window with response.redirect that would solve it.

At the time of redirecting, it's already too late to decide where the response should go. That's determined when the request is sent, so you would have to set the target before the form is posted.

Sending the mail from the server sounds like a better idea, as that doesn't require a mail program to be installer and configured on the client computer. If you want the user to be able to put text in the mail, that is easily done with input box(es). Attaching files can even be done by letting the user upload the files to the server, and put those as attachments in the mail.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Forced accept.

EE Admin
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.