The solution to send mail with Jmail component is wrong.

  

The website server I am responsible for is not protected by a firewall. I am often hacked. I have to let a friend who is doing network management help me to set some permissions on the service. I didn't expect to finish it. After the permission is set, the website can't send mail with Jmail component, every time it prompts:

Server object error 'ASP 0178 : 80070005'
Server.CreateObject access error
../sendmail.asp , line 3

The call to Server.CreateObject failed while checking permissions. Deny access to this object. Code

view on line 3 is Set JMail = Server.CreateObject ( "JMail.SMTPMail"), this question gives me a headache for a long time, on google, csdn checked numerous times, the solution is not found Later, because of the busy work, I just left it to the side, and it was half a year.

recently forced to work requirements, no automatic e-mail function is really very convenient, the website has received a lot of form submission, I would like to send an email notification immediately to your mailbox, so take this issue again Check it out, remove the jmail component and reload it. After installing it, test the email, unsuccessful, use the Ajiang probe to query, show that the Jmail component is not open, search the Internet for a while, inadvertently find a website. The answer is that the IIS account is not open to read and write permissions to the dll file, right-click the jmail.dll file in the installation path, select the property, add the ISUR_xxx and IWAM_xxx accounts, give write permission, and determine. Test, found that the mail can be sent, but the speed is very slow, okay, half of the success.

My server is a two-line export, there is an intranet IP, try to replace the external network IP with the intranet IP, find the code JMail.ServerAddress = "xxx.xxx.xxx.xxx" , changed to the internal network IP, test, successful, 1 second will be sent out, and this problem has been solved.

summary:

has encountered a problem Jmail components of mail, one by one to find the following points.

1. Check if the smtp service on the server has been started.

2. After installing jmail, give IIS users write access to jmail.dll file.

3. Use the Ajiang probe to see if the Jmail component has been successfully opened.

4. Send the code test with the correct mail.

attachment mail sending test code:
dim JMail
on error resume next
Set JMail = Server.CreateObject ( "JMail.SMTPMail")
JMail.ServerAddress = "xxx. Xxx.xxx.xxx" 'Your server's IP or domain name
JMail.LazySend = true
JMail.Charset = mcharset
JMail.ContentType = "text/html"
JMail.Sender = "xxx @xxx.com" 'Sender's Mailbox
JMail.Subject = "Test Send Mail"
JMail.AddRecipient "[email protected]" 'Recipient's Mailbox
JMail.Body = "Test Mail"< BR>JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.Execute
JMail.close
set JMail=nothing
if Err.number<>0 then
response.write err.description
err.clear
else
response.write "send successful"
end if

Copyright © Windows knowledge All Rights Reserved