戰國策 CDO Mail 範本

戰國策 CDO Mail 範本:

以下 "" 內有資料的為範本,請替換為正確資訊

===

<%
Set objMail = CreateObject("CDO.Message")
objMail.Subject = "Nss-Test"           '發信主題
objMail.From = "nss@nss.com.tw"   '發信者電子信箱
objMail.To = "nss@nss.com.tw"       '收件者電子信箱
objMail.TextBody = "Nss-Test"         '信件內容

objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'SMTP 伺服器位址
objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="localhost"   '此填入localhost不用變更
'SMTP 伺服器連線 Port
objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
'是否使用 SSL 連線 (True or False)
objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
'連線伺服器逾時時間
objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
'SMTP 伺服器是否需要驗證
objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'SMTP 伺服器使用者名稱
objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "nss@nss.com.tw"   '不允許使用外部信箱.ex:@gmail.com
'SMTP 伺服器使用者密碼
objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "1234"   '發信者電子信箱密碼

objMail.Configuration.Fields.Update

objMail.Send
set objMail=nothing
%>

===

請特別注意,透過本司主機localhost發信,發信者不允許使用外部信箱.ex:@gmail.com


Was this article helpful?

mood_bad Dislike 1
mood Like 0
visibility Views: 2297