ASP.Net環境下使用Jmail組件發送郵件[收藏]

來源:互聯網
上載者:User
ASP.Net環境下使用Jmail組件發送郵件[收藏]

Posted on 2006-01-26 15:16 聽棠.NET 閱讀(1664) 評論(5)  編輯 收藏 引用 收藏至365Key 所屬分類: 技術積累 ASP.Net環境下使用Jmail組件發送郵件

 

配置環境:.Net Framework 1.1,Imai8.02,w3Jmail4.3

實現過程:

不同於在Asp中使用Jmail,直接使用 Server.CreateObject("Jmail.Message")就可以了。在.Net環境中,需要進行設定。

1.安裝jmail4.3

2.找到jmail.dll(Program Files/Dimac/w3JMail4下)

3.執行Program Files/Microsoft Visual Studio .NET/FrameworkSDK/Bin/ildasm.exe(可使用Visual Studio .Net 2003 命令提示),

格式如下:tlbimp c:/Program Files/Dimac/w3JMail4/jmail.dll /out:myJmail.dll /namespace:myJmail

產生myJmail.dll後,copy到web的根目錄的bin目錄。在ASP.Net頁面中,用這個方法引用:

Jmail.aspx

<%@ Page Language="C#" ContentType="text/html"%>

<%@ Import Namespace="myJmail" %>

<script runat="server">

protected void Page_Load(Object Src, EventArgs E)

{

 

Message jmail=new Message();

jmail.From="sss";

jmail.AddRecipient("lsg@ckocoo.com",null,null);

jmail.MailServerUserName="brookes";

jmail.MailServerPassWord="walkor";

jmail.Subject="jmail c#";

jmail.Send("mail.lsg.com",false);

</script>

 

Tlbimp:

Microsoft .Net Framework Type Library to Assembly Converter

真是暈啊,沒想到.NET裡有這個功能啊,我照上面的進行了轉換,確實發送成功了!!:)

 

相關關鍵詞:
相關文章

聯繫我們

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