Tập lệnh ASP sau có thể được sử dụng để gửi email bằng CDOSYS.
Dim iConfig Dim theFlds Dim objCDOMail Set iConfig = Server.CreateObject ("CDO.Configuration") Set theFlds = iConfig.Fields 'Set and update fields properties theFlds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 theFlds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.servwise.com" theFlds("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 theFlds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 theFlds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 theFlds("http://schemas.microsoft.com/cdo/configuration/sendusername")="name@email.com" theFlds("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword" theFlds.Update 'Create the e-mail server object Set objCDOMail = Server.CreateObject("CDO.Message") Set objCDOMail.Configuration = iConfig Err.Clear objCDOMail.From = "sender@emaladdress.com" objCDOMail.To = "recipient@emaladdress.com" objCDOMail.Subject = "Email Subject" objCDOMail.TextBody="Email Body" objCDOMail.Send 'Close the server mail object Set objCDOMail = Nothing Set theFlds= Nothing Set iConfig = Nothing
Bạn có thể tìm thêm các cấu hình khác tại: http://www.w3schools.com/asp/asp_send_email.asp
>>> Xem thêm: Làm cách nào để tắt các quy trình IDLE do Mail Clients tạo ra?