Hey guys,I have an excel sheet with one of the columns as name .There are many rows with same name and I wish to mail all the rows with same person name to that person(given there is a column specifying email address).I will be thankful for your suggestions.
The following is my 'sending email' code:
Imports System.Net.Mail
Public Class SendEmail
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim message As New MailMessage
Dim smtp As New SmtpClient
message.To.Add("EmailAddress")
message.From = New MailAddress("example@gmail.com")
message.Subject = "Hello World"
message.Body = "Hello world 2012"
smtp.Host = "smtp.gmail.com"
smtp.Port = "587"
smtp.EnableSsl = True
smtp.Credentials = New Net.NetworkCredential("example@gmail.com", "example123")
smtp.Send(message)
End Sub