Active部件不能创建对象
为什么我引用了JMAIL4.0 library, 但还是Active部件不能创建对象代码是网上搜索下来,如下:
Option Explicit
Sub SendMail(Optional ByVal sSubject As String, Optional ByVal sBody As String, Optional ByVal sFileName As String)
Dim jmail As Object
Set jmail = CreateObject("jmail.Message ")
If sFileName <> " " Then jmail.AddAttachment sFileName '附件
jmail.Charset = "gb2312 "
jmail.Silent = False
jmail.Priority = 1 '邮件状态,1-5 1为最高
jmail.MailServerUserName = "****" 'Email帐号
jmail.MailServerPassWord = "****" 'Email密码
jmail.FromName = "邮件 " '发信人姓名
jmail.From = "****@ " '发邮件地址地址
jmail.Subject = sSubject '主题
jmail.AddRecipient "****@ " '收信人地址
jmail.Body = sBody '信件正文
jmail.Send ("smtp. ") 'SMTP服务器,如smtp.
Set jmail = Nothing
End Sub
Sub Command1_Click()
SendMail "测试 ", "我爱你 ", "这里填附件地址 "
MsgBox "OK "
End Sub
百思不得其解,我的系统是windows2003 +vb6,原来用这个组件做windows2003 +asp时都可以的,现在为什么不可以呢??