Home    
Log In    
Share Code    
Join    

Navigation
 Skip Navigation Links.

Forums
Skip Navigation Links.

Search

 

Advertisement
 
VB.NET Source Code > Send SMTP E-Mail Source Code
Details
Author: ptaylor
Views: 4215

Send SMTP E-Mail
Description
Send an E-Mail using an SMTP Server

No E-Mail client required
 
 
Code:
Public Sub SendEMail(ByVal Message As String, ByVal EMailAddress As String, ByVal Subject As String)
    Dim EMail As New System.Net.Mail.MailMessage
    Dim SMTPServer As New System.Net.Mail.SmtpClient
    Dim Authentication As New Net.NetworkCredential("login name/email", "password")

    EMail.To.Add(EMailAddress)
    EMail.From = New System.Net.Mail.MailAddress("from@domain.co.uk")
    EMail.Body = Message
    EMail.Subject = Subject

    SMTPServer.Host = "smtp.yourdomain.co.uk"
    SMTPServer.Port = 25
    SMTPServer.Credentials = Authentication

    SMTPServer.Send(EMail)
End Sub  
Date Added: 02/09/2007 13:01:38





Comments
haritaylorsnet Date: 15/06/2010 07:21:37
  smtp
 


If you log in you can add a comment of your own!
 
 
Welcome Guest
 
  Log In Name
 
  Password
 
 
Statistics
Your Details: Not Logged In
  Join Date: N/A
  Last Logon: N/A
  Code Snippets: N/A
  Code Comments: N/A
  Forum Posts: N/A
  Forum Subjects: N/A

Site Wide
  Code Snippets: 32
  Code Comments: 2
  Forum Posts: 52
  Forum Subjects: 24
 
Random Code
Try Error Handle
Try ... Catch ... Error

Language: VB.NET

 
Advertisement


All the Source Code and Tutorials on this site are free for you to use as you require.