Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27027

Help with sending E-mails through VB.NET

$
0
0
First off i am new here!
I am not sure if i am posting in the right forum but oh well.
So down to the problem.
So i am creating a email program in vb, Microsoft visual studios 2012.
This isnt really an issue but more of a lack of knowledge.
Say i want to mass send an email, like 100 (used for example) emails to one address, How would i do this? i do already have the code for sending one email at a time on a gmail SMTP server but i want to make it so i can send multiple emails to one user.
And if there is anyone that would go as far as to explain on how to get this to work with a TrackBar much would be appreciated!:thumb:
Code i already have:
Code:

Imports System.Net.Mail

Public Class Form1

    Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click

    End Sub

    Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click

    End Sub

    Private Sub CloseToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CloseToolStripMenuItem.Click
        Close()
    End Sub

    Private Sub AboutToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AboutToolStripMenuItem.Click

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim Mail As New MailMessage
        Mail.Subject = "Test Email"
        Mail.To.Add(TextBox4.Text)
        Mail.From = New MailAddress(TextBox2.Text)
        Mail.Body = TextBox1.Text

        Dim SMTP As New SmtpClient("smtp.gmail.com")
        SMTP.EnableSsl = True
        SMTP.Credentials = New System.Net.NetworkCredential(TextBox2.Text, TextBox3.Text)
        SMTP.Port = "587"
        SMTP.Send(Mail)
    End Sub
End Class


Viewing all articles
Browse latest Browse all 27027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>