使用jmail接收邮件时报的错,代码如下:
Dim pop3
Set pop3 = CreateObject("jmail.POP3")
pop3.Connect txtmail.Text, pwd.Text, "smtp.163.com" '这句报错了
收件箱.Caption = "收件箱(" & pop3.Count & ")"
If pop3.Count > 0 Then
Dim txtmsg
Set txtmsg = pop3.Messages.Item(1)
reto = ""
recc = ""
Dim recipients
recipients = pop3.recipients
separato = ","
For i = 0 To recipients.Count - 1
If i = recipients.Count - 1 Then
separator = ""
End If
Dim re
re = recipients.Item(i)
If re.ReType = 0 Then
reto = reto & re.Name & " " & re.EMail & ">" & re.EMail & separator
Else
recc = reto & re.Name & " " & re.EMail & ">" & re.EMail & separator
End If
Next
txtzt.Text = pop3.Subject
txtmail.Text = pop3.FromName
repepole.Text = reto
csren.Text = recc
txtnr.Text = pop3.Body
End If
pop3.Disconnect
Dim pop3
Set pop3 = CreateObject("jmail.POP3")
pop3.Connect txtmail.Text, pwd.Text, "smtp.163.com" '这句报错了
收件箱.Caption = "收件箱(" & pop3.Count & ")"
If pop3.Count > 0 Then
Dim txtmsg
Set txtmsg = pop3.Messages.Item(1)
reto = ""
recc = ""
Dim recipients
recipients = pop3.recipients
separato = ","
For i = 0 To recipients.Count - 1
If i = recipients.Count - 1 Then
separator = ""
End If
Dim re
re = recipients.Item(i)
If re.ReType = 0 Then
reto = reto & re.Name & " " & re.EMail & ">" & re.EMail & separator
Else
recc = reto & re.Name & " " & re.EMail & ">" & re.EMail & separator
End If
Next
txtzt.Text = pop3.Subject
txtmail.Text = pop3.FromName
repepole.Text = reto
csren.Text = recc
txtnr.Text = pop3.Body
End If
pop3.Disconnect
还是老老实实地引用,有什么方法就列出来了
Set pop3 = CreateObject("jmail.POP3")
改为
Dim pop3 as New jmail.POP3
2、你下载的jmail组件版本是否过低。
这句话 文档里是小写的connect ,可是我写成小写的 但是他会自动变成大写的。