lotus收到的外部邮件是html语言,使用c# 和 Lotus Domino Objects Com访问 IBM Lotus Notes ,发送HTML格式邮件.doc...

使用c# 和 Lotus Domino Objects Com访问 IBM Lotus Notes ,发送HTML格式邮件

使用c# 和 Lotus Domino Objects Com访问 IBM Lotus Notes ,发送HTML格式邮件??

2011-02-27 18:44:03|??分类:?Lotus|举报|字号?订阅

1.本机安装Lotus Notes客户端。

2.注册组件:regsvr32 "C:\Program Files\lotus\notes\nlsxbe.dll"。

3.打开vs2010,新建ASP.NET Web应用程序,取名“NotesMail”。

4.添加引用,选 “com” 找到“Lotus Domino Objects”,点 “确定”。

5.新建文件夹 “EmailTemplate”,新建 HTML页,取名 “DefaultTemplate.htm”,在

里写html代码。例如:

1:

2:

3:

4:

5:

6:

7: Dear {0},

8: 您好!

9:

{1}

10: 请点击连接:報修單查詢

11:

此為系統郵件,請勿回覆!

12:

13:

6.新建一个类 “EmailTemplateGenerate.cs”用于读取文件

1: using System;

2: using System.Web;

3: using System.IO;

4: ?

5: namespace NotesMail

6: {

7: public class EmailTempGenerate

8: {

9: public string GetTemplate(string path)

10: {

11: path = HttpContext.Current.Server.MapPath(path);

12: using (StreamReader sr = new StreamReader(path))

13: {

14: try

15: {

16: string result = sr.ReadToEnd();

17: return result;

18: }

19: catch (Exception err)

20: {

21: throw new Exception(err.Message);

22: }

23: }

24: }

25: }

26: }

7.新建一个类? “Common”,再建一个静态方法? “AppPath”? 用于读取IP/主机名+应用程序根路径

1: using System.Web;

2: ?

3: namespace NotesMail

4: {

5: public class Common

6: {

7: public static string AppPath

8: {

9: get

10: {

11: return HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath;

12: }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值