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
Public Class WebForm1
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(sender As Object, e As System.EventArgsHandles Me.Load
        If Not IsPostBack Then
            Me.Button1.Text = "Send Mail"
            Me.Button1.Attributes("onClick") = "window.location = 'mailto:somebody@VB-Tips.com?subject=VBTips demo&body=I hope this helps?';"
        End If
    End Sub
End Class
>



1 Previous Next