Public Shared Sub SendMessage(ByVal subject As String, ByVal messageBody As String, _ ByVal fromAddress As String, ByVal toAddress As String, ByVal ccAddress As String) Dim message As New MailMessage() Dim client As New SmtpClient() 'Set the sender's address message.From = New MailAddress(fromAddress) 'Allow multiple "To" addresses to be separated by a semi-colon If (toAddress.Trim.Length > 0) Then For Each addr As String In toAddress.Split(";"c) message.To.Add(New MailAddress(addr)) Next End If 'Allow multiple "Cc" addresses to be separated by a semi-colon If (ccAddress.Trim.Length > 0) Then For Each addr As String In ccAddress.Split(";"c) message.CC.Add(New MailAddress(addr)) Next End If 'Set the subject and message body text message.Subject = subject message.Body = messageBody 'TODO: *** Modify for your SMTP server *** 'Set the SMTP server to be used to send the message client.Host = "Host" 'Your SMTP Server goes here client.Credentials = New System.Net.NetworkCredential( User, Pass) 'login info for the SMTP 'client.Port = "" 'if needed remove the ' from before it client.EnableSsl = False 'SSl for SMTP 'Send the e-mail message client.Send(message) End Sub
iBotModz CBox
Sned Mail FUnction
Started by xxsoftwarexx, Jan 04 2009 02:01 PM
5 replies to this topic
#1
Posted 04 January 2009 - 02:01 PM
#2
Posted 05 January 2009 - 01:46 PM
Um, to anyone who doesn't know, this is for Visual Basic.NET. Next time tell what it is for.
#3
Posted 12 January 2009 - 08:55 AM
You didnt write this ? :S lol + you need to spell the title right
#4
Posted 12 January 2009 - 01:55 PM
lol yh he cant spell send hahaYou didnt write this ? :S lol + you need to spell the title right
#5
Posted 12 January 2009 - 10:33 PM
umm stop with the flaming, every post you have made lately has been flaming a member in some way...lol yh he cant spell send haha
and btw you cant spell "yeah" right >.>
#6
Posted 22 January 2009 - 11:55 AM
You should add a small [code=auto:0] box displaying available SMTP hosts. (Google is a free one)