|
本帖最后由 神往之地 于 2022-9-6 15:42 编辑
以下代码可以正常群发邮件,就是没有OUTLOOK邮箱的签名,OUTLOOK中签名已设置。
请老师帮忙修改下,使用其可以自动插入签名。自己试着修改都没有成功,感谢!
Public Function sendmail(sendto As String, cc_emails As String, subj As String, mbody As String, filepath1 As String, filepath2 As String)
On Error Resume Next
Dim oLapp As Object
Dim oItem As Object
Set oLapp = CreateObject("Outlook.application")
Set oItem = oLapp.createitem(0)
With oItem
.Subject = subj
.To = sendto
.CC = cc_emails
.htmlbody = mbody
.Attachments.Add filepath1
.Attachments.Add filepath2
.Send
If Err.Number = 0 Then
sendmail = "发送成功"
Else
sendmail = "发送失败:" & Err.Description
End If
End With
Set oLapp = Nothing
Set oItem = Nothing
End Function
|
|