|
|
|
พี่ครับใครพอจะบอกได้ไหมครับว่า จะเขียนส่งเมล์ ผ่าน outlook (ใช้ server mail เป็น exchange server) |
|
|
|
|
|
|
|
Quote:exchange server
มันมี SMTP บริการให้อยู่ใช่ไหม๊ครับ ถ้ามีคุรก็ Authen ได้ปกติครับ
Code (VB.NET)
Sub Page_Load(sender As Object, e As EventArgs)
Dim myMail As New MailMessage()
myMail.To = "[email protected]"
myMail.From = "[email protected]"
myMail.Subject = "My Subject"
myMail.BodyFormat = MailFormat.Text
myMail.Body = "My Body & Description"
Dim strSMTP,cdoSendUsingPort,cdoBasic,UserName,Password As String
strSMTP = "localhost"
cdoSendUsingPort = 2
cdoBasic = 1
UserName = "weerachai"
Password = "password"
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", strSMTP)
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25)
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort)
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic)
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", UserName)
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", Password)
SmtpMail.SmtpServer = strSMTP
SmtpMail.Send(myMail)
myMail = Nothing
Me.lblText.Text = "Mail Sending."
End Sub
|
|
|
|
|
Date :
2015-07-29 16:51:38 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|