码迷,mamicode.com
首页 > Web开发 > 详细

dominio发送html邮件

时间:2015-04-01 09:42:13      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:domino lotus   domino xpages   

 最近在网上找到的发送html代码的邮件,今天 发出来,大家 共享


1)方法一

http://ozinisle.blogspot.com/2010/11/send-html-content-as-mail-using-lotus.html

2)方法二

http://www.codestore.net/store.nsf/unid/BLOG-20091022-0419


web代理调用如下
	Dim Session As New NotesSession
	Dim Curdoc As NotesDocument
	Dim Db As NotesDatabase
        Dim url As String
        Dim link As String

	Set Curdoc=Session.Documentcontext

	url=StrLeft(Db.Httpurl,"?OpenDatabase")+_
	"/x_notice.xsp?action=openDocument&documentId="+Curdoc.Universalid
	link="<a href="""+url+""" target=""_blank"">文档链接</a>"
	Call cBasic.sendHTMLContentAsMail(Curdoc.yauditor(0),"" ,"",_
	"通知,主题:["&Curdoc.yFormname(0)&"],当前状态:"&Curdoc.Status(0),link)
	Call curdoc.save(True,false)
	

Function sendHTMLContentAsMail(recipients As Variant,ccTo As Variant,bccTo As Variant, _
		Subject As String,bodyHtmlContent As String)
		'Declare Variables 
		Dim s As New NotesSession
		Dim db As NotesDatabase
		Dim body As NotesMIMEEntity
		Dim stream As NotesStream
		Dim host As String
		Dim message As  NotesDocument 
		
		On Error GoTo errHandler
		
		Set db = s.CurrentDatabase
		Set message=db.CreateDocument
		'Capture the server name and filepath for use in URLs
		Dim ServerName As New NotesName( db.Server )
		host = "http://" + ServerName.Common & ".com"
		
		s.ConvertMIME = False ' Do not convert MIME to rich text
		Set stream = s.CreateStream
		Set body = message.CreateMIMEEntity
		message.Subject =Subject
		message.SendTo =recipients
		message.CopyTo =ccTo
		message.BlindCopyTo =bccTo
		message.RecNoOutOfOffice = "1"   
		Call stream.WriteText (bodyHtmlContent)
		' Ensure the MIME content will be recognized as HTML   (Must be after the stream is written)
		Call body.SetContentFromText (stream, "text/html;charset=UTF-8", ENC_NONE) 
		Call message.Send (False)  
		
		s.ConvertMIME = True ' Restore conversion
		Exit Function
errHandler:
		MsgBox Error,,CStr(Erl)
		Exit Function
	End Function






dominio发送html邮件

标签:domino lotus   domino xpages   

原文地址:http://blog.csdn.net/weijia3624/article/details/44785617

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!