Salut a tous aujourd'hui je vais vous apprendre comment créé un E-Mail Bomber et pouvoir envoyer des fichier en plus
(vous pouvez l'utiliser aussi comme simple envois d'E-Mail)
Bon j'avais cherché déjà pas mal de chose a se sujet et tout ceux que j'ai trouvé se sont des sources qui ne marchais pas (envois E-Mail) donc a force de voir tout ces
(leech de code, je dit leech car c'est toujours la même source qui est proposé un peut partout sur la toile) et qui ne marche pas du tout .
Bref j'ai codé et rectifié toutes ces erreur et en prime je vous montre comment réaliser un Mail Bomber (Envois de plusieurs message par E-Mail)
Donc ont va commencer par le commencement alors créez une application de form.
Ce que vous aurez besoin dans ce tuto :
. Sept label :
Nom des labels : ( label1 ; label2; ""3 ; ""4 ; ""5 ; ""6 , ""7 )
. Quatre buttons :
Nom des boutons : ( Envoyer ; Arrêt ; Ajouter ; Suprimer )
. Une ProgressBar :
Nom de la ProgressBar : ( ProgressBar1 )
. Une ListBox :
Nom de la ListeBox : ( ListBox1 )
. Une RichTextBox :
Nom de la RichTextBox : ( RichTextBox1 )
. Un TabControl :
Nom du TabControl : ( TabControl1 )
. Cinq TextBox :
Nom des TextBox : ( TextBox1 ; TextBox2 ; usernametext ; Password ; Nombre )
. Un OpenFileDialog :
Nom du OpenFileDialog : ( OpenFileDialog1 )
. Un Timer :
Nom du Timer : ( Timer1 )
Puis les disposer comme ça (enfin c'est un exemple)
Cliquez sur les images pour les voir en grands
Voila la suite dans le code, ont commence par Importer :
Imports System.Net.Mail
Puis juste en dessous de (ex:)
Public Class Form1 :
Double cliquer sur OpenFileDialog1 et rajoutez :
Double cliquer sur le buttons envoyer et rajoutez :
Double cliquer sur le buttons Arrêt et rajoutez :
Double cliquer sur le Timer1 et rajoutez :
Double cliquer sur la TextBox "Nombre" et rajoutez :
Double cliquer sur le buttons Ajouter et rajoutez :
Double cliquer sur le buttons Suprimer et rajoutez :
Voila une fois terminé vous devez avoir ce code identique aux miens :
Alors vous pouvez utiliser d'autre serveur si vous le voulez car a chaque fois qu'ont envoient une dizaine de message d'affiler avec Hotmail il vous mette un capcha et il faut se connecter sur sont compte pour pouvoir renvoyer plein de message d'affiler .
Pour ça je vous propose d'aller faire un tours pour voir ici :
Ce lien n'est pas visible, veuillez vous connecter pour l'afficher. Je m'inscris!
Vous pouvez récupérer pas mal de port de server comme Gmail , Gmx ect ..
Après c'est a vous de voir hein :p
(vous pouvez l'utiliser aussi comme simple envois d'E-Mail)
Bon j'avais cherché déjà pas mal de chose a se sujet et tout ceux que j'ai trouvé se sont des sources qui ne marchais pas (envois E-Mail) donc a force de voir tout ces
(leech de code, je dit leech car c'est toujours la même source qui est proposé un peut partout sur la toile) et qui ne marche pas du tout .
Bref j'ai codé et rectifié toutes ces erreur et en prime je vous montre comment réaliser un Mail Bomber (Envois de plusieurs message par E-Mail)
Donc ont va commencer par le commencement alors créez une application de form.
Ce que vous aurez besoin dans ce tuto :
. Sept label :
Nom des labels : ( label1 ; label2; ""3 ; ""4 ; ""5 ; ""6 , ""7 )
. Quatre buttons :
Nom des boutons : ( Envoyer ; Arrêt ; Ajouter ; Suprimer )
. Une ProgressBar :
Nom de la ProgressBar : ( ProgressBar1 )
. Une ListBox :
Nom de la ListeBox : ( ListBox1 )
. Une RichTextBox :
Nom de la RichTextBox : ( RichTextBox1 )
. Un TabControl :
Nom du TabControl : ( TabControl1 )
. Cinq TextBox :
Nom des TextBox : ( TextBox1 ; TextBox2 ; usernametext ; Password ; Nombre )
. Un OpenFileDialog :
Nom du OpenFileDialog : ( OpenFileDialog1 )
. Un Timer :
Nom du Timer : ( Timer1 )
Puis les disposer comme ça (enfin c'est un exemple)
Cliquez sur les images pour les voir en grands
Voila la suite dans le code, ont commence par Importer :
Imports System.Net.Mail
Puis juste en dessous de (ex:)
Public Class Form1 :
Double cliquer sur OpenFileDialog1 et rajoutez :
Code:
[COLOR=Blue]For Each[/COLOR] track [COLOR=Blue]As String In [/COLOR]OpenFileDialog1.FileNames
ListBox1.Items.Add(track)
[COLOR=Blue]Next
[/COLOR]
Code:
Timer1.Enabled = [COLOR=Blue]True[/COLOR]
Envoyer.Text = ([COLOR=DarkRed][COLOR=Red]"[/COLOR][COLOR=Red]Envois "[/COLOR][/COLOR] + (Nombre.Text) + ([COLOR=Red]" messages"[/COLOR]))
Code:
Timer1.Stop()
Label6.Text = 0
ProgressBar1.Value = 0
Code:
[COLOR=Blue]Dim[/COLOR] MyMailMessage [COLOR=Blue]As New[/COLOR] [COLOR=Teal]MailMessage[/COLOR]()
MyMailMessage.From = New [COLOR=Teal]MailAddress[/COLOR](usernametext.Text)
MyMailMessage.To.Add(TextBox1.Text)
MyMailMessage.Subject = TextBox2.Text
MyMailMessage.Body = RichTextBox1.Text
[COLOR=Blue]For [/COLOR]counter = 0 [COLOR=Blue]To [/COLOR]ListBox1.Items.Count - 1
[COLOR=Blue]Dim [/COLOR]Attach [COLOR=Blue]As [/COLOR]Net.Mail.[COLOR=Teal]Attachment [/COLOR]= New Net.Mail.[COLOR=Teal]Attachment[/COLOR](ListBox1.Items(counter))
MyMailMessage.Attachments.Add(Attach)
[COLOR=Blue]Next[/COLOR]
[COLOR=Blue]Dim [/COLOR]SMTPServer [COLOR=Blue]As New[/COLOR] [COLOR=Teal]SmtpClient[/COLOR]([COLOR=Red]"smtp.live.com"[/COLOR])
SMTPServer.Port = 587
SMTPServer.Credentials = [COLOR=Blue]New[/COLOR] System.Net.[COLOR=Teal]NetworkCredential[/COLOR](usernametext.Text, Password.Text)
SMTPServer.EnableSsl = [COLOR=Blue]True[/COLOR]
[COLOR=Blue]Dim [/COLOR]sendnumber [COLOR=Blue]As Integer[/COLOR] = Nombre.Text
[COLOR=Blue]If [/COLOR]Label6.Text < sendnumber [COLOR=Blue]Then[/COLOR]
Timer1.Interval = 100
ProgressBar1.Value = Label6.Text
ProgressBar1.Minimum = 0
ProgressBar1.Maximum = sendnumber
ProgressBar1.Update()
[COLOR=Blue]Try[/COLOR]
Label6.Text = Val(Label6.Text) + 1
SMTPServer.Send(MyMailMessage)
[COLOR=Blue]Catch[/COLOR] ex [COLOR=Blue]As [/COLOR][COLOR=Teal]SmtpException[/COLOR]
[COLOR=Teal]MessageBox[/COLOR].Show(ex.Message)
[COLOR=Blue] End Try[/COLOR]
[COLOR=Blue]ElseIf[/COLOR] Label6.Text = sendnumber [COLOR=Blue]Then[/COLOR]
Timer1.Stop()
ProgressBar1.Value = 0
[COLOR=Teal]MessageBox[/COLOR].Show([COLOR=Red]"Les "[/COLOR] + (Nombre.Text) + ([COLOR=Red]" E-Mail's sont envoyé a "[/COLOR]) + (TextBox1.Text) + ([COLOR=Red]"!"[/COLOR]))
[COLOR=Blue]End If[/COLOR]
Code:
[COLOR=Blue]If [/COLOR]Nombre.Text = "" [COLOR=Blue]Then[/COLOR]
Nombre.Text = 1
[COLOR=Blue]End If[/COLOR]
[COLOR=Blue]If [/COLOR]Nombre.Text <= 0 [COLOR=Blue]Then[/COLOR]
[COLOR=Teal]MessageBox[/COLOR].Show([COLOR=Red]"Vous ne pouvez pas envoyer 0 messages!"[COLOR=Black])[/COLOR][/COLOR]
[COLOR=Blue]End If[/COLOR]
[COLOR=Blue]If [/COLOR]Nombre.Text >= 26 [COLOR=Blue]Then[/COLOR]
[COLOR=Teal]MessageBox[/COLOR].Show([COLOR=Red]"Si vous dépassé les 25 envois votre compte risque d’être suspendu !"[/COLOR])
Nombre.Text = 25
[COLOR=Blue]End If[/COLOR]
Code:
OpenFileDialog1.ShowDialog()
Code:
[COLOR=Blue]For Each[/COLOR] track [COLOR=Blue]As String In[/COLOR] OpenFileDialog1.FileNames
ListBox1.Items.Clear()
[COLOR=Blue] Next
[/COLOR]
Code:
[COLOR=Blue]Imports [/COLOR]System.Net.Mail
[COLOR=Blue]Public Class [COLOR=Teal]Form1[/COLOR][/COLOR]
[COLOR=Blue]Private Sub[/COLOR] OpenFileDialog1_FileOk([COLOR=Blue]ByVal [/COLOR]sender [COLOR=Blue]As[/COLOR] System.[COLOR=Teal]Object[/COLOR], [COLOR=Blue]ByVal [/COLOR]e [COLOR=Blue]As[/COLOR] System.ComponentModel.[COLOR=Teal]CancelEventArgs[/COLOR]) [COLOR=Blue]Handles[/COLOR] OpenFileDialog1.FileOk
[COLOR=Blue]For Each[/COLOR] track [COLOR=Blue]As String In [/COLOR]OpenFileDialog1.FileNames
ListBox1.Items.Add(track)
[COLOR=Blue]Next
End Sub[/COLOR]
[COLOR=Blue]
Private Sub[/COLOR] Envoyer_Click([COLOR=Blue]ByVal [/COLOR]sender [COLOR=Blue]As [/COLOR]System.[COLOR=Teal]Object[/COLOR], [COLOR=Blue]ByVal [/COLOR]e [COLOR=Blue]As [/COLOR]System.[COLOR=Teal]EventArgs[/COLOR]) Handles Envoyer.Click
Timer1.Enabled = [COLOR=Blue]True[/COLOR]
Envoyer.Text = ([COLOR=DarkRed][COLOR=Red]"[/COLOR][COLOR=Red]Envois "[/COLOR][/COLOR] + (Nombre.Text) + ([COLOR=Red]" messages"[/COLOR]))
[COLOR=Blue]End Sub[/COLOR]
[COLOR=Blue]Private Sub[/COLOR] Arrêt_Click([COLOR=Blue]ByVal [/COLOR]sender [COLOR=Blue]As [/COLOR]System.[COLOR=Teal]Object[/COLOR], [COLOR=Blue]ByVal[/COLOR] e [COLOR=Blue]As [/COLOR]System.[COLOR=Teal]EventArgs[/COLOR]) Handles Arrêt.Click
Timer1.Stop()
Label6.Text = 0
ProgressBar1.Value = 0
[COLOR=Blue]End Sub[/COLOR]
[COLOR=Blue]Private Sub[/COLOR] Timer1_Tick([COLOR=Blue]ByVal [/COLOR]sender [COLOR=Blue]As [/COLOR]System.[COLOR=Teal]Object[/COLOR], [COLOR=Blue]ByVal [/COLOR]e [COLOR=Blue]As [/COLOR]System.[COLOR=Teal]EventArgs[/COLOR]) Handles Timer1.Tick
[COLOR=Blue]Dim[/COLOR] MyMailMessage [COLOR=Blue]As New[/COLOR] [COLOR=Teal]MailMessage[/COLOR]()
MyMailMessage.From = New [COLOR=Teal]MailAddress[/COLOR](usernametext.Text)
MyMailMessage.To.Add(TextBox1.Text)
MyMailMessage.Subject = TextBox2.Text
MyMailMessage.Body = RichTextBox1.Text
[COLOR=Blue]For [/COLOR]counter = 0 [COLOR=Blue]To [/COLOR]ListBox1.Items.Count - 1
[COLOR=Blue]Dim [/COLOR]Attach [COLOR=Blue]As [/COLOR]Net.Mail.[COLOR=Teal]Attachment [/COLOR]= New Net.Mail.[COLOR=Teal]Attachment[/COLOR](ListBox1.Items(counter))
MyMailMessage.Attachments.Add(Attach)
[COLOR=Blue]Next[/COLOR]
[COLOR=Blue]Dim [/COLOR]SMTPServer [COLOR=Blue]As New[/COLOR] [COLOR=Teal]SmtpClient[/COLOR]([COLOR=Red]"smtp.live.com"[/COLOR])
SMTPServer.Port = 587
SMTPServer.Credentials = [COLOR=Blue]New[/COLOR] System.Net.[COLOR=Teal]NetworkCredential[/COLOR](usernametext.Text, Password.Text)
SMTPServer.EnableSsl = [COLOR=Blue]True[/COLOR]
[COLOR=Blue]Dim [/COLOR]sendnumber [COLOR=Blue]As Integer[/COLOR] = Nombre.Text
[COLOR=Blue]If [/COLOR]Label6.Text < sendnumber [COLOR=Blue]Then[/COLOR]
Timer1.Interval = 100
ProgressBar1.Value = Label6.Text
ProgressBar1.Minimum = 0
ProgressBar1.Maximum = sendnumber
ProgressBar1.Update()
[COLOR=Blue]Try[/COLOR]
Label6.Text = Val(Label6.Text) + 1
SMTPServer.Send(MyMailMessage)
[COLOR=Blue]Catch[/COLOR] ex [COLOR=Blue]As [/COLOR][COLOR=Teal]SmtpException[/COLOR]
[COLOR=Teal]MessageBox[/COLOR].Show(ex.Message)
[COLOR=Blue] End Try[/COLOR]
[COLOR=Blue]ElseIf[/COLOR] Label6.Text = sendnumber [COLOR=Blue]Then[/COLOR]
Timer1.Stop()
ProgressBar1.Value = 0
[COLOR=Teal]MessageBox[/COLOR].Show([COLOR=Red]"Les "[/COLOR] + (Nombre.Text) + ([COLOR=Red]" E-Mail's sont envoyé a "[/COLOR]) + (TextBox1.Text) + ([COLOR=Red]"!"[/COLOR]))
[COLOR=Blue]End If[/COLOR]
[COLOR=Blue]End Sub[/COLOR]
[COLOR=Blue]Private Sub[/COLOR] Nombre_TextChanged([COLOR=Blue]ByVal [/COLOR]sender [COLOR=Blue]As[/COLOR] System.[COLOR=Teal]Object[/COLOR], [COLOR=Blue]ByVal [/COLOR]e [COLOR=Blue]As [/COLOR]System.[COLOR=Teal]EventArgs[/COLOR]) [COLOR=Blue]Handles[/COLOR] Nombre.TextChanged
[COLOR=Blue]If [/COLOR]Nombre.Text = "" [COLOR=Blue]Then[/COLOR]
Nombre.Text = 1
[COLOR=Blue]End If[/COLOR]
[COLOR=Blue]If [/COLOR]Nombre.Text <= 0 [COLOR=Blue]Then[/COLOR]
[COLOR=Teal]MessageBox[/COLOR].Show([COLOR=Red]"Vous ne pouvez pas envoyer 0 messages!"[COLOR=Black])[/COLOR][/COLOR]
[COLOR=Blue]End If[/COLOR]
[COLOR=Blue]If [/COLOR]Nombre.Text >= 26 [COLOR=Blue]Then[/COLOR]
[COLOR=Teal]MessageBox[/COLOR].Show([COLOR=Red]"Si vous dépassé les 25 envois votre compte risque d’être suspendu !"[/COLOR])
Nombre.Text = 25
[COLOR=Blue]End If
End Sub
[/COLOR]
[COLOR=Blue]Private Sub[/COLOR] Ajouter_Click([COLOR=Blue]ByVal [/COLOR]sender [COLOR=Blue]As [/COLOR]System.[COLOR=Teal]Object[/COLOR], [COLOR=Blue]ByVal [/COLOR]e [COLOR=Blue]As [/COLOR]System.[COLOR=Teal]EventArgs[/COLOR]) [COLOR=Blue]Handles [/COLOR]Ajouter.Click
OpenFileDialog1.ShowDialog()
[COLOR=Blue]End Sub[/COLOR]
[COLOR=Blue]Private Sub[/COLOR] Suprimer_Click([COLOR=Blue]ByVal [/COLOR]sender [COLOR=Blue]As [/COLOR]System.[COLOR=Teal]Object[/COLOR], [COLOR=Blue]ByVal [/COLOR]e [COLOR=Blue]As [/COLOR]System.[COLOR=Teal]EventArgs[/COLOR]) [COLOR=Blue]Handles [/COLOR]Suprimer.Click
[COLOR=Blue]For Each[/COLOR] track [COLOR=Blue]As String In[/COLOR] OpenFileDialog1.FileNames
ListBox1.Items.Clear()
[COLOR=Blue] Next
End Sub
End Class
[/COLOR]
Pour ça je vous propose d'aller faire un tours pour voir ici :
Ce lien n'est pas visible, veuillez vous connecter pour l'afficher. Je m'inscris!
Vous pouvez récupérer pas mal de port de server comme Gmail , Gmx ect ..
Après c'est a vous de voir hein :p
Voila une fois finit niveaux graphique et codage (le mien):
Voila merci d'avoir suivit ce tuto et bon codage a tous !
Bye
Voila merci d'avoir suivit ce tuto et bon codage a tous !
Bye