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 ThenMsgBox "发送成功"End IfEnd Sub