Bloggging about .NET tips, tricks, and so much more...!

Thursday, November 22, 2007

VB.NET Code to Send Mail

Private Sub SendEmail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendEmail.Click


Dim mailman As New Chilkat.MailMan() ' Any string passed to


UnlockComponent begins a 30-day trial.
mailman.UnlockComponent("anything")
mailman.SmtpHost = "smtp.earthlink.net"

Dim email As New Chilkat.Email()
email.Subject = "This is the subject"
email.Body = "This is the body"
email.AddTo("Chilkat Support", "support@chilkatsoft.com")
email.From = "John Smith john.smith@chilkatsoft.com"

If (Not mailman.SendEmail(email)) Then
MsgBox(mailman.LastErrorXml)
Else
MsgBox("Mail Sent!")
End If

End Sub

No comments:

PRC Board Exam Results

Feeds from Jehzlau Concepts