简体   繁体   English

经典的asp发送电子邮件

[英]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. 如果您不想使用任何DLL来发送电子邮件,我认为唯一的解决方案是从您的ASP到将负责发送电子邮件的外部邮件服务器进行呼叫 You could use an HTTP post to accomplish it. 您可以使用HTTP发布来完成它。

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. 在邮件服务器上, send.asp将负责使用服务器或CDONTS上安装的DLL发送电子邮件。 This solution would only work if you have another server with the required DLL installed . 仅当您安装了具有所需DLL的其他服务器时,此解决方案才有效

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. 现在,如果您没有其他服务器可供使用,则应该查看服务器上安装的邮件引擎的API。 If are using Mail Enable , there exists a pickup directory in which emails to send can be dropped for processing . 如果使用Mail Enable ,则存在一个提取目录,可以在其中放置要发送的电子邮件进行处理 But it all depends on the software you are running. 但这完全取决于您所运行的软件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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