1 Previous Next 

AspNet: Open a default mailclient using code behind


A button, has to be draged on a webform, and this code has than to be pasted in a webform code behind Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
    Me.Button1.Text = "Send Mail"
    Me.Button1.Attributes("onClick") = window.location='" & _
      "mailto:somebody@windowsformsdatagridhelp.com?" & _
      "subject=DataGridHelp demo&body=I hope this helps?';"
End If
End Sub



1 Previous Next