Send email in VB.NET 2005
Posted on 2007-10-02
Hi experts.. I hope you guys can help me with this issue.. Thanks in advance.
In the event click of my command button.. I'd like to send an email... I tried this:
Imports System.Net.Mail.MailMessage (this line I put it in the first row)
Protected Sub btnsend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsend.Click
Dim emailTitle As String = "My Email Title"
Dim emailMessage As Net.Mail.MailMessage
Dim body As String = "This will appear in the body of my email"
emailMessage = New Net.Mail.MailMessage "from@emailaddress", "to@emailaddress", "Test", "TEST2")
MsgBox("You request was sent, thanks")
Dim mailClient As New Net.Mail.SmtpClient("Here goes the IP server", 25)
Catch ex As Exception
Am I doing something wrong?? Could you tell me what is the best way to send a confirmation mail.. in VB.NET 2005.. please...