'產生smtpclient物件
Dim gmailinfo() As String = Split(System.Configuration.ConfigurationManager.AppSettings("gmailinfo"), ",")
Dim smtp As New SmtpClient(gmailinfo(0), Val(gmailinfo(1)))
smtp.Credentials = New System.Net.NetworkCredential(gmailinfo(2), gmailinfo(3))
Net.ServicePointManager.SecurityProtocol = Net.SecurityProtocolType.Tls12
smtp.EnableSsl = True
smtp.Send(email)
留言