| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1206 人关注过本帖
标题:VB用SENDMAIL发邮件,带个附件,发送不了,请大家帮帮
只看楼主 加入收藏
wuyuede
Rank: 1
等 级:新手上路
帖 子:110
专家分:0
注 册:2007-3-29
结帖率:75%
收藏
 问题点数:0 回复次数:1 
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


'谢谢大家
搜索更多相关主题的帖子: SENDMAIL 邮件 附件 
2009-11-12 22:07
wuyuede
Rank: 1
等 级:新手上路
帖 子:110
专家分:0
注 册:2007-3-29
收藏
得分:0 
ding
2009-11-13 10:00
快速回复:VB用SENDMAIL发邮件,带个附件,发送不了,请大家帮帮
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.033447 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved