用ASP發送郵件

來源:互聯網
上載者:User
可以通過Jmail組件發送郵件.首先要在WEB伺服器安裝JMAIL組件.下面是一個對象執行個體,可以通過call SendMail (receive)的方法來調用發送郵件

可以通過Jmail組件發送郵件.
首先要在WEB伺服器安裝JMAIL組件.
下面是一個對象執行個體,可以通過call SendMail (receive)的方法來調用發送郵件
<%
Sub SendMail(receive)
On Error Resume Next
Set jmail = Server.CreateObject("JMAIL.Message")
jmail.silent = false '屏蔽例外錯誤,返回FALSE跟TRUE兩值
jmail.logging = true '啟用郵件日誌
jmail.Charset = "gb2312" '
jmail.AddRecipient receive '郵件收件者的地址
jmail.From = "admin@XXX.com.cn" '寄件者的E-MAIL地址
jmail.FromName = "主題" '寄件者名
jmail.MailServerUserName = "admin" '信箱使用者名
jmail.MailServerPassword = "xxx" '郵箱密碼
jmail.Subject = "Message" '郵件主題
jmail.Body = "body" '郵件內容
jmail.Priority = 3 '郵件的緊急程式,1 為最快,5 為最慢, 3 為預設值
mailserver="smtp.xxx.net" '發件伺服器
jmail.Send(mailserver) '執行郵件發送(通過郵件伺服器地址)
If Err.Number<>0 then
        sendMsg="發送失敗!"
    Else
        sendMsg="已發送!"
    End If
    Response.Write(sendMsg)
jmail.Close()
set jmail=nothing
end sub
%>
jmail 組件可以網上下載



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.