Asp classic VBScript启动默认邮件窗口

Asp classic VBScript启动默认邮件窗口,asp-classic,vbscript,email,Asp Classic,Vbscript,Email,只是想知道在经典的ASP/VBScript中是否有可能启动默认邮件客户端的新窗口 我尝试了以下方法: set objOutlk = createobject("Outlook.Application") set objMail = objOutlk.createitem(olMailItem) 但只得到一个错误:ActiveX无法创建对象:Outlook.Application 任何建议都将不胜感激 Rob.如果您想提供一种简单的方法来打开查看您(asp)页面的用户的默认邮件客户端消息,只需添

只是想知道在经典的ASP/VBScript中是否有可能启动默认邮件客户端的新窗口

我尝试了以下方法:

set objOutlk = createobject("Outlook.Application")
set objMail = objOutlk.createitem(olMailItem)
但只得到一个错误:ActiveX无法创建对象:Outlook.Application

任何建议都将不胜感激


Rob.

如果您想提供一种简单的方法来打开查看您(asp)页面的用户的默认邮件客户端消息,只需添加一个
mailto:
hyperlink:

<a href="mailto:You@acme.com?subject=Hello%20World&body=Hi%20there">Send Msg</a>

mailto:
将触发浏览器打开默认(或配置的)邮件客户端

您可以附加一个查询字符串来定义主题行和邮件正文——在我的示例中,主题是“Hello World”,正文文本是“Hi there”

请注意,空格是url编码的
%20

经过一番思考(感谢你们中的一些人的提示),运行此客户端是有意义的,我使用了以下JScript:

 <script type="text/javascript">

 function send() {
 alert("clicked")
     var recpt = "info@example.ccTLD"
     var subj = "FASTER BETTER SOONER: Look at Monash Rowville rail now"
     var text = "<Enter your name and address here> %0D%0DMelbourne is growing and more people need transport. With concern about climate change and rising petrol prices, Melbourne's growth is not sustainable without more and better public transport.%0D%0DVictorians want more people catching public transport, cycling and walking; fewer trucks on our roads, more freight on rail; and fewer kilometres travelled by car and truck.%0D%0DPublic transport should: be fast, frequent, reliable, affordable and safe; grow as Melbourne grows; be available to all Melbournians; and be managed as an integrated, co-ordinated network.%0D%0DThis means bringing forward existing public transport projects, committing to new projects and accelerating programs to move freight off our roads and onto rail.%0D%0DIt also means looking very closely at the impact on greenhouse gas emissions of any new transport projects like tunnels and freeways.%0D%0DWe especially urge you to look at a feasibility study for a Monash Rowville rail line. %0D%0DAs Melbourne's population grows, better public transport will both reduce traffic congestion and provide a much needed antidote to spiralling petrol prices. "
     var bcc = "people@example.ccTLD"
     var content = new Array()

     content[0] = "mailto:"
     content[1] = recpt
     content[2] = "?subject="
     content[3] = subj
     content[4] = "&body="
     content[5] = text
     content[6] = "&bcc="
     content[7] = bcc
     content = content.join("")
     window.location = content
 }

函数send(){
警报(“单击”)
var recpt=”info@example.ccTLD"
var subc=“更快更好更快:现在看看莫纳什-罗维尔铁路”
变量文本="%0D%0D墨尔本正在增长,越来越多的人需要交通。由于对气候变化和油价上涨的担忧,如果没有更多更好的公共交通,墨尔本的增长是不可持续的。%0D%0D悉尼人希望更多的人乘坐公共交通工具、骑自行车和步行;公路上的卡车更少,铁路上的货物更多;公里更少s乘汽车和卡车出行。%0D%0D公共交通应该:快速、频繁、可靠、负担得起且安全;随着墨尔本的发展而发展;向所有墨尔本人开放;并作为一个综合、协调的网络进行管理。%0D%0D这意味着推进现有的公共交通项目,致力于新项目并加快项目的实施将货物从公路转移到铁路上。%0D%0D这也意味着要密切关注隧道和高速公路等新交通项目对温室气体排放的影响。%0D%0D我们特别敦促您研究莫纳什-罗维尔铁路线的可行性研究。%0D%0D墨尔本的人口增长,更好的公共交通将同时带来好处缓解交通拥堵,为油价飙升提供急需的解药。”
变量bcc=”people@example.ccTLD"
var content=新数组()
内容[0]=“邮件收件人:”
内容[1]=接收
内容[2]=“?主题=”
内容[3]=主题
内容[4]=“&正文=”
内容[5]=文本
内容[6]=“&bcc=”
内容[7]=密件抄送
content=content.join(“”)
window.location=内容
}

这似乎是我所期望的结果


Rob

只是为了确保:您正在尝试在客户端计算机上运行VBScript或ASP经典服务器端脚本?抱歉,这是ASP服务器端。但如果需要,可以在客户端执行此操作吗?应该在客户端计算机上打开一个邮件窗口,预先填充一些数据,然后允许客户端发送邮件,以便通过t跟踪邮件heir exchangeWell如果是服务器端,该如何在客户端上运行?也许你只是在寻找
mailto:
hyperlink?客户端是否会按预期的方式工作?为Filburt干杯。我也可以尝试一下,但我认为我在下面找到的答案就是我想要的,除非你能看到JS有什么问题?如果你也需要的话r对于用户发送邮件所需的一些数据,使用JS构建链接是一种可行的方法-基本上,您将得到类似的
href
值,就像我的静态示例一样。