ASP使用JMail發送郵件

來源:互聯網
上載者:User
前天寫了個《php使用JMail發送郵件》的例子,今天偶然用到了郵件的發送,於是用asp翻寫了一下: 程式碼<%
dim jmail : set jmail=Server.CreateObject("jmail.message")
'屏蔽例外錯誤,靜默處理
jmail.silent=true
'編碼必須設定,否則中文會亂碼
jmail.charset="gb2312"
'發信人郵件地址和名稱,能自訂,可以和郵件發送帳號不同
jmail.from="admin@domain.com"
jmail.fromname="webmaster"
'添加多個郵件接受者
jmail.addRecipient("xxxx@qq.com")
'郵件主題和本文資訊
jmail.subject="asp+jmail測試郵件"
jmail.body="asp+jmail測試發送郵件內文"
'發信郵件帳號和密碼
jmail.mailServerUserName="xxxx@sogou.com"
jmail.mailServerPassword="123456"
'發送的時候附帶SMTP發信伺服器位址
dim retval : retval=jmail.send("smtp.mail.sogou.com")
if err.number<>0 then err.clear : Response.Write "ERROR"
if retval=true then Response.Write "發送成功" else Response.Write "發送失敗"
%>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.