dominio发送html邮件

 最近在网上找到的发送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






郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。