[Release]SMS/SMTP Sender

Posts 1–7 of 7 · Page 1 of 1
[Release]SMS/SMTP Sender
Just thought i'd share some code,It is a sms/email sender/bomber
checkbox1 disables the combo box1, if you just want to just email someone and if your using an email sending to sms leave the provider combo box emtpy
Works with most Canadian and american service providers
Code:
Imports System.Net.Mail
Public Class Form1
    Public message As MailMessage = Nothing
    Public ctThread As System.Threading.Thread
    Dim Provider As String
    Dim Provider2 As String
    Dim MyMailMessage As New MailMessage()
    Dim SMTPServer As New SmtpClient

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim I As Integer
        For I = 1 To CStr(txtNum.Value)
            Dim ctThread As New Threading.Thread(AddressOf Thread)
            ctThread.Start()
            ctThread.Priority = Threading.ThreadPriority.Highest
            Threading.Thread.CurrentThread.IsBackground = True
        Next
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim thr As Threading.Thread
        thr = Threading.Thread.CurrentThread
        Select Case thr.ThreadState
            Case Threading.ThreadState.Running
                thr.Interrupt()
            Case Threading.ThreadState.Suspended
                Threading.Thread.Sleep(10)
                thr.Resume()
        End Select
    End Sub
    Public Sub Thread()
        Control.CheckForIllegalCrossThreadCalls = False
        Try
            Dim MyMailMessage As New MailMessage()
            MyMailMessage.From = New MailAddress(TextBox1.Text & Provider2)
            MyMailMessage.To.Add(TextBox3.Text & Provider)
            MyMailMessage.Subject = (TextBox4.Text)
            MyMailMessage.Body = TextBox5.Text
            Dim SMTPServer As New SmtpClient("shawmail.vc.shawcable.net")
            SMTPServer.Port = 25
            SMTPServer.Send(MyMailMessage)
        Catch ex As Exception
            Threading.Thread.Sleep(1000)
        Finally
            MyMailMessage.Dispose()
        End Try
    End Sub

    Private Sub ComboBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Combo1.TextChanged
        If Combo1.Text = "Bell" Then
            Provider = "@txt.bellmobility.ca"
        End If
        If Combo1.Text = "Telus" Then
            Provider = "@msg.telus.com"
        End If
        If Combo1.Text = "Rogers" Then
            Provider = "@pcs.rogers.com"
        End If
        If Combo1.Text = "AT&T" Then
            Provider = "@txt.att.net"
        End If
        If Combo1.Text = "Alltel" Then
            Provider = "@message.alltel.com"
        End If
        If Combo1.Text = "Boost Mobile" Then
            Provider = "@myboostmobile.com "
        End If
        If Combo1.Text = "Nextel" Then
            Provider = "@messaging.nextel.com"
        End If
        If Combo1.Text = "Sprint PCS" Then
            Provider = "@messaging.sprintpcs.com "
        End If
        If Combo1.Text = "T-Mobile" Then
            Provider = "@tmomail.net"
        End If
        If Combo1.Text = "Verizon" Then
            Provider = "@vtext.com"
        End If
        If Combo1.Text = "Virgin Mobile USA" Then
            Provider = "@vmobl.com"
        End If
    End Sub

 
    Private Sub Combo2_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Combo2.TextChanged
        If Combo2.Text = "Bell" Then
            Provider = "@txt.bellmobility.ca"
        End If
        If Combo2.Text = "Telus" Then
            Provider = "@msg.telus.com"
        End If
        If Combo2.Text = "Rogers" Then
            Provider = "@pcs.rogers.com"
        End If
        If Combo2.Text = "AT&T" Then
            Provider = "@txt.att.net"
        End If
        If Combo2.Text = "Alltel" Then
            Provider = "@message.alltel.com"
        End If
        If Combo2.Text = "Boost Mobile" Then
            Provider = "@myboostmobile.com "
        End If
        If Combo2.Text = "Nextel" Then
            Provider = "@messaging.nextel.com"
        End If
        If Combo2.Text = "Sprint PCS" Then
            Provider = "@messaging.sprintpcs.com "
        End If
        If Combo2.Text = "T-Mobile" Then
            Provider = "@tmomail.net"
        End If
        If Combo2.Text = "Verizon" Then
            Provider = "@vtext.com"
        End If
        If Combo2.Text = "Virgin Mobile USA" Then
            Provider = "@vmobl.com"
        End If
    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked = True Then
            Combo1.Text = ""
            Combo2.Text = ""
            Combo2.Enabled = False
            Combo1.Enabled = False
        Else
            Combo1.Enabled = True
            Combo2.Enabled = True
        End If
    End Sub

    Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        System.Windows.Forms.WebBrowser.CheckForIllegalCrossThreadCalls = False
    End Sub
End Class
Either release your whole project as open source, or make a tutorial out of it. This is just some clean code without any instructions. I do know how to use this, however a lot of people don't.

So as I said above, release an OS program or make a tutorial
Thanks for sharing your code, I would like to see it as a tutorial with code explanation for the users, and there are a few tuts here as well on this.

But if nothing else, it is here now , So thanks
Virus scan + screenshot missing.
its the source if your don't trust it,then delete the compiled EXEs
still, you need a virus scans + screenshot for it to be approved mate. and I'd like a tutorial coz wtf? what buttons are we putting in, any labels? any timer? etc?
I removed it, This section does not allow potentially malicious software
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us