|
Dim re '总是提示错误的方法或参数无效 是多了一个参数 发送邮件 按钮
For i = 1 To ListView1.ListItems.Count
ss = ""
ss = "今天是" & Date & " 是本月第" & zs & "周" & "。现有" & vbCrLf & Trim(ListView1.ListItems(i).SubItems(3)) & " 事件需要你们 " & ListView1.ListItems(i) & " 去处理,"
ss = ss & vbCrLf & " 此事件现在仍然处于 " & Trim(ListView1.ListItems(i).SubItems(4)) & " 状态,事件责任人是 " & Trim(ListView1.ListItems(i).SubItems(5)) & Chr(10) & ",此事件开始于 " & Trim(ListView1.ListItems(i).SubItems(7)) & "。具体内容可查看周会系统及相关人员了解。"
re = SendMail(Trim(mrc2.Fields(1) & ""), Date & "周会跟踪系统邮件提醒", ss, "zsd@ssaabn.com", "zhujk", "22233"mail.ssaabn.com")
End Sub
我使用变量ss,传递到SendMail( )函数去执行传送邮件。用了Chr(10)、vbCrLf 但还是没有换行,请问如何控制 字体颜色 ,请高手指点。。。。
Public Function SendMail(MailtoAddress, Subject, MailBody, MailFrom, MailServerUser, MailServerPass, MailServer)
' on error resume next
Dim JMail As JMail.Message, JMailstat
Set JMail = CreateObject("JMail.Message")
If Err Then
Err.Clear
JMail.Close
Set JMail = Nothing
Exit Function
End If
JMail.Charset = "gb2312" '邮件字符集
JMail.Silent = True '忽略错误
JMail.ContentType = "text/html" '邮件编码
JMail.AddRecipient MailtoAddress '收件人地址
'JMail.ReturnReceipt = True '是否收条(验证中)
JMail.From = MailFrom '发件人邮箱
JMail.FromName = "周会跟踪系统"
'JMail.MailDomain = MailDomain '邮箱所在域名(验证中)
'JMail.FromName = FromName '发件人姓名
JMail.MailServerUserName = MailServerUser '邮箱用户名
JMail.MailServerPassWord = MailServerPass '邮箱密码
JMail.Subject = Subject '邮件主题
'JMail.Body = MailBody '邮件正文(纯文本格式)
JMail.HTMLBody = MailBody '邮件正文(HTML格式)
'JMail.Priority = 3 '邮件等级,1为加急,3为普通,5为低级
JMailstat = JMail.Send(MailServer)
If JMailstat Then
SendMail = True
Else
SendMail = False
End If
JMail.Close
Set JMail = Nothing
End Function
|
|