jump to navigation

ASP Sendmail to SMTP December 9, 2009

Posted by jbanju in Programming ASP.NET.

Imports System.Net.Mail

Dim mail As New SmtpClient
Dim message As New MailMessage(“jitti@mail.com”, “jitti@mail.com”, “test”, “body”)
With message
.BodyEncoding = Encoding.UTF8  ‘ ตรงนี้จะเป็นการกำหนดรูปแบบตัวหนังสือนะครับ
End With
With mail
.Host = “smtp.com”  ‘ smtp ที่เราใช้อยู่
.DeliveryMethod = SmtpDeliveryMethod.Network  ‘ กำหนดการส่งโดยใช้ smtp
.Send(message)  ‘ ส่ง e-mail
End With



No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: