JMail 是經典 ASP 元件,提供 JMail.SMTPMail、JMail.Message 等物件,支援 SMTP 發信、POP3 收信、MIME 編碼、附件、HTML 郵件等功能。免費版最高 4.5 版,足滿足大多數 ASP 應用需求。
JMail45_free.msi 或 JMail 4.5 免費版雙擊 JMail45_free.msi 或解壓後執行 setup.exe,出現歡迎畫面。

選擇 「I accept the license agreement」** →「Next」。

點擊「Browse」→ 選擇如 D:\Program\Jmail\ →「OK」→「Next」。




出現完成畫面,點擊「Finish」。


test_jmail.asp:
<%
Set jmail = Server.CreateObject("JMail.SMTPMail")
jmail.ServerAddress = "smtp.example.com"
jmail.Sender = "test@example.com"
jmail.Subject = "JMail 測試"
jmail.Body = "安裝成功!"
jmail.AddRecipient "recipient@example.com"
If jmail.Execute Then
Response.Write "發送成功"
Else
Response.Write "發送失敗: " & jmail.ErrorMessage
End If
%>
800a01ad - ActiveX component can't create object,檢查:regsvr32 jmail.dll 手動註冊<%
Set msg = Server.CreateObject("JMail.Message")
msg.Silent = True
msg.Logging = True
msg.Charset = "UTF-8"
msg.ContentType = "text/html"
msg.From = "noreply@example.com"
msg.FromName = "系統通知"
msg.Subject = "您的報表已準備好"
msg.Body = "報表下載
請點擊附件下載。
"
msg.AddAttachment Server.MapPath("/reports/monthly.pdf"), "monthly.pdf"
msg.MailServerUserName = "noreply@example.com"
msg.MailServerPassword = "password"
msg.Send "smtp.example.com"
%>
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB;Data Source=.;Initial Catalog=DB;User ID=sa;Password=pwd"
Set rs = conn.Execute("SELECT email, name FROM users WHERE subscribed=1")
Set msg = Server.CreateObject("JMail.Message")
msg.MailServerUserName = "news@example.com"
msg.MailServerPassword = "pwd"
msg.Silent = True
Do While Not rs.EOF
msg.From = "news@example.com"
msg.Subject = "每週精選內容"
msg.Body = "親愛的 " & rs("name") & ",歡迎閱讀本週精選..."
msg.ClearRecipients
msg.AddRecipient rs("email")
msg.Send "smtp.example.com"
rs.MoveNext
Loop
%>
msg.Charset = "UTF-8",網頁、資料庫、郵件內容全鏈路 UTF-8msg.ErrorMessage 記錄日誌System.Net.Mail、MailKit、FluentEmail 等原生庫歷史地位:JMail 是 ASP 時代 (2000-2010) 郵件發送的「標準配備」。雖已停止更新,但大量存量系統仍在運行。維護舊專案時,熟悉其物件模型 (
SMTPMail簡易發送、Message完整功能) 仍是必備技能。
IIS 禁止 .exe 檔案下載三大招:MIME 類型移除、NTFS 權限鎖定、URLScan 擴充名封鎖
Windows 伺服器強化實戰:從合規清單到風險導向的防護策略
Windows Server 2003 安全加固 14 項核心清單:NTFS 權限、防火牆、服務精簡、審核策略、註冊表加固
Apache HTTP Server 完整配置與管理實戰指南
IIS 7.5 透過 web.config 實現偽靜態:常見 CMS 規則完整範本
中小企業伺服器效能設計實戰:從業務場景到壓力測試的科學選型方法
IIS Express 完整配置指南:applicationhost.config 結構解析、多站點/虛擬目錄/SSL/避免管理員權限實戰