Try
Dim msg As New System.Net.Mail.MailMessage()
'msg.[To].Add("vinay.shukla88@gmail.com")
'msg.[Bcc].Add("jitendra.srivastava555@gmail.com")
msg.[To].Add(TextBox3.Text)
msg.[Bcc].Add(TextBox4.Text)
msg.Subject = TextBox1.Text
msg.Body = TextBox2.Text
msg.IsBodyHtml = False
Dim SMPclint As New SmtpClient()
SMPclint.Host = "smtp.gmail.com"
SMPclint.EnableSsl = True
Dim NetCry As New NetworkCredential()
NetCry.UserName = "sandeepyadav.bca@gmail.com"
NetCry.Password = "pwd"
SMPclint.UseDefaultCredentials = True
SMPclint.Credentials = NetCry
Dim fromMailAddr As New MailAddress("sandeepyadav.bca@gmail.com", "")
msg.From = fromMailAddr
SMPclint.Port = 587
SMPclint.Send(msg)
MessageBox.Show("Message Sent")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Dim msg As New System.Net.Mail.MailMessage()
'msg.[To].Add("vinay.shukla88@gmail.com")
'msg.[Bcc].Add("jitendra.srivastava555@gmail.com")
msg.[To].Add(TextBox3.Text)
msg.[Bcc].Add(TextBox4.Text)
msg.Subject = TextBox1.Text
msg.Body = TextBox2.Text
msg.IsBodyHtml = False
Dim SMPclint As New SmtpClient()
SMPclint.Host = "smtp.gmail.com"
SMPclint.EnableSsl = True
Dim NetCry As New NetworkCredential()
NetCry.UserName = "sandeepyadav.bca@gmail.com"
NetCry.Password = "pwd"
SMPclint.UseDefaultCredentials = True
SMPclint.Credentials = NetCry
Dim fromMailAddr As New MailAddress("sandeepyadav.bca@gmail.com", "")
msg.From = fromMailAddr
SMPclint.Port = 587
SMPclint.Send(msg)
MessageBox.Show("Message Sent")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
No comments:
Post a Comment