這個功能要裝上Windows NT OPTON PACK 的SMTP SERVICE。
首先
Set mail = Server.CreateObject("CDONTS.NewMail")以呼叫SMTP Service的元件,然後設定:
mail.To = "收件者E-Mail地址"
mail.From = "寄件者的E-Mail地址"
mail.Subject = "主旨"
mail.Body = "E-mail內文"
最後Mail.Send即開始發送郵件。
例如:
<%
Set mail = Server.CreateObject("CDONTS.NewMail")
mail.TO = "[email protected]"
mail.From = "[email protected]"
mail.Subject = "主題"
mail.Body = "E-Mail內容"
mail.Send