Dundas 發信、上傳檔案套件 for ASP

使用Dundas Mail套件發送郵件,此處以中華電信SMTP為例
'建立元件
Set objMail = Server.CreateObject("Dundas.Mailer")
objMail.SMTPRelayServers.Add "msa.hinet.net" 'SMTP server
objmail.HtmlBodyCharSet = "big5"
objMail.Subject = "信件主旨"
objMail.FromName = "寄件者姓名"
objMail.FromAddress = "寄件者地址"
strTo = my15 '收件者地址,可add多組
objMail.TOs.Add strTo
objMail.CCs.add "副本收件者地址" '可add多組.
objMail.htmlBody = "以HTML格式發送內容"
On Error Resume Next '錯誤處理error
objMail.SendMail '寄出sending

'-check sending email is success or failure---------
If Err.Number <> 0 Then
  errmail = "寄送郵件發生錯誤 : "& Err.Description
Else
  errmail = "確認郵件已成功寄送到 : "& strTo
End If

留言