JMail component is the most commonly used mail sending tool of ASP, own a website, have already used this jmail component for 8 years, but do not know why in the 12th suddenly appear unable to send the mail the question,
Later, after testing the code, the IIS reported that the error is: The object does not support this property or method: ' Jmail.serveraddress ', encountered do not understand, of course, the first degree Niang, Baidu 2 days have not found the same error cases and solutions,
My code is as follows:
Dim JMail
Set jmail=server.createobject ("Jmail.message")
If Err Then
Sendmail= "<br><li> no JMail components installed </li>"
Err.Clear
Exit function
End If
"" "" "" "" "" "" "" "" "" "" "" "" "" "" "."
' Mail level, 1 for expedited, 3 for normal, 5 for low
priority=2
Maildomain= ""
Fromname=adtitle
Mailfrom=mailserverusername
Mailtoaddress=mailtoaddress ' mail address
Mailtoname=mailtoname ' Mail Recipient
Subject=subject ' theme
Mailbody=mailbody ' content
jmail.charset= "GB2312" ' Message encoding
Jmail.silent=true
Jmail.contenttype = "text/html" message body format
' jmail.serveraddress= mailserver ' the SMTP server used to send mail
' If the server requires SMTP authentication, you also need to specify the following parameters
Jmail.mailserverusername = Mailserverusername ' Login user name
Jmail.mailserverpassword = Mailserverpassword ' login password
' jmail.maildomain = MailDomain ' domain name (if you are logged in with a user name such as "[email protected]", specify domain.com
Jmail.addrecipient mailtoaddress,mailtoname ' Mail Recipient
Jmail.subject=subject ' theme
' jmail.hmtlbody=mailbody ' message body (HTML format)
Jmail.body=mailbody ' message body (plain text format)
' jmail.fromname=fromname ' sender's name
Jmail.from = Mailfrom ' sender email
' jmail.priority=priority ' message level, 1 for expedited, 3 for normal, 5 for low
Jmail.send (MailServer)
SendMail =jmail.errormessage
Jmail.close
Set jmail=nothing
The problem is not solved first put a day, today, think again, actually want to see if the other ASP program e-mail is to use what to achieve, want to replace the JMail component,
I checked an ASP program, it uses the JMail component, but it writes the number of lines of code without my so much, I just a row of comparison, found that it unexpectedly did not ' jmail.serveraddress= mailserver ' used to send mail SMTP server sentence code.
Don't you need to fill it out? Then I commented on all the red ones.
Test result: succeeded.
Although I do not understand why, why the use of 8 years are no problem, now have problems, but finally the mail can be sent, but also solved.
JMail Component Object does not support this property or method: ' jmail.serveraddress ' workaround