SMTP 메일전송

VB.NET 2015. 6. 1. 10:24

Imports System.Net.Mail

 

Dim Mail As New MailMessage
        Mail.From = New MailAddress("보내는주소")
        Mail.To.Add("받는주소")
        Mail.Subject = "메일제목"
        Mail.Body = "메일내용"

 

Dim SMTP As New SmtpClient
        SMTP.Host = "SMTP서버"
        SMTP.EnableSsl = True
        SMTP.Credentials = New System.Net.NetworkCredential("아이디", "패스워드")
        SMTP.Port = "포트"
        SMTP.Send(Mail) '메일전송

Posted by G4.
,