封装了一个发邮件的dll,支持附件,HTML

封装了一个发邮件的dll,支持附件,HTML

vb调用代码:

Private Declare Function SendMail Lib "sMailDll.dll" _
(ByRef mi As MailInfo) As Integer


Private Type MailInfo
     strSmtpAddr As String     ' smtp服务器地址
     strPort As String         'smtp端口
      strAccount As String     ' 帐号
     strPassword As String     '密码
     strSendfrom As String     ' 发送源地址
     strSendto As String     ' 目地地址
      strSenderName As String     ' 发送者姓名
     strReceiverName As String     ' 接收者姓名
     strSubject As String     ' 邮件主题
     strContent As String     ' 邮件正文
     strAdjunct As String     '附件列表 多个附件以","隔开
     isHtml As Integer       '是否以HTML发送
End Type


Private Sub Command1_Click()
     Dim mi As MailInfo

     mi.strSmtpAddr = T1.Text   ' smtp服务器地址
     mi.strPort = T2.Text      'smtp端口
      mi.strAccount = T3.Text    ' 帐号
     mi.strPassword = T4.Text    '密码
     mi.strSendfrom = T6.Text    ' 发送源地址
     mi.strSendto = T8.Text    ' 目地地址
     mi.strSenderName = T5.Text    ' 发送者姓名
     mi.strReceiverName = T7.Text    ' 接收者姓名
     mi.strSubject = T9.Text    ' 邮件主题
     mi.strContent = T11.Text    ' 邮件正文
     If T10.Text = "" Then
     mi.strAdjunct = ""
     Else
     mi.strAdjunct = T10.Text    '附件列表 多个附件以","隔开
     End If
     mi.isHtml = 1     '是否以HTML发送End With
'mi.strAccount = "123456"
     'MsgBox mi.strAdjunct
     'Exit Sub
'Dim iSend As Integer
'iSend = SendMail(mi)
If SendMail(mi) = 1 Then
MsgBox "发送成功"
End If
End Sub

sMailDll.rar 下载

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值