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

How to add CC and BCC email send ?

$
0
0
I recently made this code

Code:

Imports System.Net.Mail
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MsgBox("This software Was made by Pwnisher and u cant resell it")
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startbtn.Click
        Timer1.start()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles stopbtn.Click
        Timer1.stop()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitbtn.Click
        End
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim MyMailMessage As New MailMessage()
        MyMailMessage.From = New MailAddress(usernamebox.Text)
        MyMailMessage.To.Add(tobox.Text)
        MyMailMessage.Subject = (subjectbox.Text)
        MyMailMessage.Body = MessageBox.Text
        Dim SMTPServer As New SmtpClient("smtp.gmail.com")
        SMTPServer.Port = 587
        SMTPServer.Credentials = New System.Net.NetworkCredential(usernamebox.Text, passwordbox.text)
        SMTPServer.EnableSsl = True
        Label1.Text = Val(Label1.Text + 1)
        SMTPServer.Send(MyMailMessage)

    End Sub

    Private Sub Label8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub
End Class


but as it shows only send emails to one person, my goal is to put the emails separated by commas like emailtest1@gmail.com,emailtest2@gmail.com .... etc in the field "to"

can someone help me out with this ?


Thanks

Viewing all articles
Browse latest Browse all 27349

Trending Articles



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