VB用SENDMAIL发邮件,带个附件,发送不了,请大家帮帮
请教下,VB用SENDMAIL发邮件,带个附件,我要把文件夹里所有文件都加到附件里发送,应该 怎么来设置
Public Function SendEMail(ByVal mFrom As String, _
ByVal mTo As String, _
mTitle As String, _
mText As String, _
mSmtp As String, _
mUserName As String, mPassWord As String, mAffixPath As
String) As Boolean
On Error GoTo Fail
Dim Email As Object, NameS As String
mAffixPath = App.Path & "\2967\*.jpg"
'这里应该怎么写?郁闷死我
NameS = "http://schemas.
Set Email = CreateObject("CDO.Message")
Email.From = mFrom
Email.To = mTo
Email.Subject = mTitle
Email.Textbody = mText
Email.AddAttachment mAffixPath
Email.AddAttachment mAffixPath
Email.Configuration.Fields.Item(NameS & "sendusing") = 2
Email.Configuration.Fields.Item(NameS & "smtpserver") = mSmtp
Email.Configuration.Fields.Item(NameS & "smtpserverport") = 25
Email.Configuration.Fields.Item(NameS & "smtpauthenticate") = 1
Email.Configuration.Fields.Item(NameS & "sendusername") = mUserName
Email.Configuration.Fields.Item(NameS & "sendpassword") = mPassWord
Email.Configuration.Fields.Update
Email.Send
SendEMail = True
Exit Function
Fail:
End Function
'谢谢大家