Click here to Skip to main content
16,017,852 members

Comments by Member 13258186 (Top 1 by date)

Member 13258186 9-Jul-17 20:58pm View    
Using mail As New MailMessage
mail.From = New MailAddress("admissioncsabnic@gmail.com")
mail.To.Add(destination.Text$)
mail.Body = lblname.Text$
'If Not OpenFileDialog1.FileName = vbNullString Then
'Dim attach As New Attachment()
Dim attach As New System.Net.Mail.Attachment(profilepic1.ImageLocation)
'MyMailMessage.Attachments.Add(attchm)
mail.Attachments.Add(attach)
'End If
mail.Subject = lblname.Text$
mail.Priority = mail.Priority.Normal
Using SMTP As New SmtpClient
'SMTP.EnableSsl = True
'SMTP.Port = "587"
'SMTP.Host = "smtp.gmail.com"
'SMTP.Credentials = New Net.NetworkCredential("ujjawal.vermanu53@gmail.com", "bholenath1994")
'SMTP.Send(mail)

SMTP.Host = "smtp.gmail.com"
SMTP.EnableSsl = True
Dim NetworkCred As NetworkCredential = New NetworkCredential("admissioncsabnic@gmail.com", "sachin@6")
SMTP.UseDefaultCredentials = True
SMTP.Credentials = NetworkCred
SMTP.Port = 587
SMTP.Send(mail)
End Using
End Using