IN .vb
Imports System.IO
Imports System.Net
Imports System.Net.Mail
Dim line As String = ""
Using reader As StreamReader = New StreamReader("c:\read.txt")
line = reader.ReadToEnd
End Using
'''Using smtp.gmail.com '''
'-------------GMAIL-------------'
Dim mailMsg1 As New Net.Mail.MailMessage
Dim fromAdd As Net.Mail.MailAddress
fromAdd = New Net.Mail.MailAddress(strloginEmailID)
mailMsg1.To.Add(dSet1.Tables(0).Rows(i).ItemArray(0).ToString())
chk = dSet1.Tables(0).Rows(i).ItemArray(0).ToString()
mailMsg1.IsBodyHtml = True
mailMsg1.Priority = MailPriority.High
mailMsg1.Subject = "BarodaWeb" ' "New Task Assign!"
mailMsg1.Body = line
Dim smtp As New Net.Mail.SmtpClient()
smtp.Host = strMailhost
smtp.Port = strMailport
smtp.EnableSsl = True
smtp.UseDefaultCredentials = False
smtp.DeliveryMethod = SmtpDeliveryMethod.Network
smtp.Credentials = New NetworkCredential(strMailid, strMailpass)
smtp.Send(mailMsg1)
'--------------------------------------------------
No comments:
Post a Comment