还请各位哥哥姐姐讲解详细一小点.
使用JMail组件。
[CODE]Private Sub Form_Load()
Dim JMail As New JMail.Message
Dim i As Long, j As Long
Dim strHtml As String
JMail.Charset = "gb2312"
'来自
JMail.From = "purana@126.com"
JMail.FromName = "purana"
'主题
JMail.Subject = "test"
'验证用户名
JMail.MailServerUserName = "purana@126.com"
'验证密码
JMail.MailServerPassWord = "xxxxxx"
JMail.Priority = 3
'JMail.HTMLBody = "<html><head><body BORDER=1><table><tr><td>ddd</td><tr></table></body></head></html>"
Open "d:\backup.sql" For Input As #1
strHtml = Input$(LOF(1), 1)
Close
JMail.Body = strHtml
'发送到
JMail.AddRecipient ("purana@126.com")
'服务器主机
JMail.Send ("smtp.126.com")
JMail.Close
Set JMail = Nothing
End Sub[/CODE]