在vb中怎么发邮件啊?
的有关信息介绍如下:调用jmail吧,比较省事 先安装jmail或注册DLL 然后VB代码如下: Private Sub Command1_Click() SendMail "测试", "我爱你", "这里填附件地址" End Sub Sub SendMail(Optional ByVal sSubject As String, _ Optional ByVal sBody As String, _ Optional ByVal sFileName As String) Dim jmail Set jmail = CreateObject("jmail.Message") If sFileName <> "\" Then jmail.Charset = "gb2312" jmail.Silent = False jmail.Priority = 1 '邮件状态,1-5 1为最高 jmail.MailServerUserName = "XXX" 'Email帐号 jmail.MailServerPassWord = "XXX" 'Email密码 jmail.FromName = "" '发信人姓名 jmail.From = "XXX@XXX.XXXX" '发邮件地址地址 jmail.Subject = ""主题 jmail.AddRecipient "XXX@XXX.XXXX" '收信人地址 jmail.body = ""'信件正文 jmail.Send ("smtp.163.com") 'SMTP服务器,如smtp.sohu.com Set jmail = Nothing End If End Sub