您的位置:首页 > Web前端 > HTML

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

2008-05-27 15:15 309 查看
封装了一个发邮件的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 下载
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐