Jump to content

  •  

  • iBotModz CBox


    Photo

    Sned Mail FUnction


    • Please log in to reply
    5 replies to this topic

    #1 xxsoftwarexx

    xxsoftwarexx

      Private

    • Members+

    • 34 posts
    • Joined: 17-April 08

    Posted 04 January 2009 - 02:01 PM

    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


    #2 yungbol

    yungbol

      Firmware Expert

    • Global Mods

    • 1,461 posts
    • Joined: 09-April 08
    • Gender:Male
    • Location:Philly

    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 sillybob123

    sillybob123

      I am a homo.

    • Members+

    • 541 posts
    • Joined: 08-May 08
    • Gender:Male
    • Location:The Computer/Xbox

    Posted 12 January 2009 - 08:55 AM

    You didnt write this ? :S lol + you need to spell the title right

    #4 Mcmodder♥

    Mcmodder♥

      I have no friends.

    • Banned

    • 622 posts
    • Joined: 03-August 08
    • Gender:Male
    • Location:???????

    Posted 12 January 2009 - 01:55 PM

    You didnt write this ? :S lol + you need to spell the title right

    lol yh he cant spell send haha

    #5 Korupt Data

    Korupt Data

      SoOoO KoRuPtAbLe

    • Retired Staff

    • 3,503 posts
    • Joined: 12-May 08
    • Gender:Male
    • Location:That file you downloaded

    Posted 12 January 2009 - 10:33 PM

    lol yh he cant spell send haha

    umm stop with the flaming, every post you have made lately has been flaming a member in some way...

    and btw you cant spell "yeah" right >.>

    #6 Dark Slipstream

    Dark Slipstream

      Blue Shadowz Owner

    • Members+

    • 2,829 posts
    • Joined: 19-April 08
    • Gender:Male
    • Location:Canada, ON

    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)