vb JMail
Sub test2()
'
On Error GoTo Err_test2
Dim Jmail
Set Jmail = CreateObject("jmail.Message")
Jmail.Charset = "gb2312"‘设置邮件的编码
Jmail.Silent = False
Jmail.Priority = 1 '设置邮件的重要性
Jmail.MailServerUserName = "username" '设置邮件的用户名
Jmail.MailServerPassWord = "123456"'设置邮件的密码
Jmail.FromName = "AAA"'设置邮件显示的发件人
Jmail.From = "username@exmple.com"’设置你的发件箱
Jmail.Subject = "abcd"'设置你的邮件标题
Jmail.AddRecipient "recevied1@exmple.com"'设置收件人信箱
Jmail.Body = "aaaaaaaa"'设置邮件正文
Jmail.AddAttachment CurrentProject.Path + "\a1.txt"'设置附件
Jmail.Send ("192.168.1.1")'设置SMTP服务器地址
Set Jmail = Nothing'释放
Err_test2:
Debug.Print Err.Description
End Sub