简体   繁体   中英

classic asp sending email

是否可以在没有cdo和其他已安装dll的情况下发送电子邮件?

If you don't want to use any DLL to send email, I think the only solution would be to make a call from you ASP to an external mail server that would be responsible for the sending of the emails. You could use an HTTP post to accomplish it.

On your server, your code should look like:

Dim url, httpBroker
url = "http://mail.yourdomain/send.asp" 
Set httpBroker = CreateObject("MSXML2.ServerXMLHTTP") 
httpBroker.open "POST", url, false 
httpBroker.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" 
httpBroker.send "to=name@gmail.com&body=<html><body>Hello!</body></html>" 
Response.write httpBroker.responseText 
Set httpBroker = Nothing 

On the mail server, send.asp will be responsible to send the email using a DLL installed on the server or CDONTS. This solution would only work if you have another server with the required DLL installed .

Now, if you don't have another server at your disposal, you should have a look at the API of the mail engine installed on your server. If are using Mail Enable , there exists a pickup directory in which emails to send can be dropped for processing . But it all depends on the software you are running.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM