发送前编辑电子邮件

发布于 2024-10-08 19:07:02 字数 1220 浏览 0 评论 0原文

我的应用程序使用以下功能来发送电子邮件。

函数 SendHTMLEMail(strFrom、strTo、strCC、strSubject、strBodyHTML)
' 创建 NewMail 对象
Set objNewMail = Server.CreateObject("CDONTS.NewMail")

' 设置发件人和收件人(后者可以是 ';' 分隔的列表)
objNewMail.From = strFrom
objNewMail.To = "[电子邮件受保护]"
objNewMail.Cc = "[电子邮件受保护]"

' 设置电子邮件主题
objNewMail.Subject = strSubject

' 构造并设置电子邮件正文
strHTMLStart = "" & strSubject & 主题“”
strHTMLEnd = ""
objNewMail.Body = strHTMLStart & strBodyHTML & ”
致:“& strTo & “
抄送:”& strCC & strHTMLEnd

' 将参数设置为普通重要性 MIME 编码和 HTML 格式的电子邮件
objNewMail.Importance = 1 '9-低,1-正常,2-高
objNewMail.BodyFormat = 0 '0-HTML,1-文本
objNewMail.MailFormat = 0 '0-MIME,1-文本
' 立即发送电子邮件
objNewMail.Send

' 释放 NewMail 对象
Set objNewMail = Nothing

End Function

我不希望自动发送电子邮件。它应该在 Outlook 中打开并允许我对其进行编辑。
任何人都可以帮助我更改我应该在代码中放入的更改,以便电子邮件打开而不是自动发送吗?

数据来自经典的asp页面,上述函数位于utils.inc中

My application uses following function to send email.

Function SendHTMLEMail (strFrom, strTo, strCC, strSubject, strBodyHTML)
' create NewMail object
Set objNewMail = Server.CreateObject("CDONTS.NewMail")

' set sender and recipients (latter can be ';' separated lists)
objNewMail.From = strFrom
objNewMail.To = "[email protected]"
objNewMail.Cc = "[email protected]"

' set Email Subject
objNewMail.Subject = strSubject

' construct and set Email's body
strHTMLStart = "" & strSubject & ""
strHTMLEnd = ""
objNewMail.Body = strHTMLStart & strBodyHTML & "
To : " & strTo & "
CC :" & strCC & strHTMLEnd

' set parameters to Normal importance MIME-encoded and HTML-formatted Email
objNewMail.Importance = 1 '9-low, 1-normal, 2-high
objNewMail.BodyFormat = 0 '0-HTML, 1-Text
objNewMail.MailFormat = 0 '0-MIME, 1-Text
' send Email now
objNewMail.Send

' release NewMail object
Set objNewMail = Nothing

End Function

I do not want the email to be sent automatically. It should open in outlook and allow me to edit it.
Can anyone help me with the change I should put here in the code so that the email opens instead of being sent automatically ?

The data is coming from a classic asp page and the above function is in utils.inc

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泅渡 2024-10-15 19:07:02

您需要了解您正在服务器中处理邮件,并且仅将 HTML 发送到客户端(网络浏览器)。

不可能从服务器操作客户端 PC 中的程序 (Outlook),除非您有一些软件(ActiveX、附加组件等)。 )在客户端计算机中。

也就是说,您可以执行此操作

response.redirect("mailto:[email protected]?subject=Hello&body=Place body here")

这将打开客户端中配置的邮件程序(这将取决于客户端 PC 的配置方式)
请注意,主题和正文的长度非常有限。

在 Firefox 3.6、Chrome 和 Internet Explorer 8 中测试(会发出安全警告)

You need to understand that you are processing the mail in the server and only sending HTML to the client (the web browser).

There is no possible way to manipulate a program (Outlook) in the client PC from the server, unless you have some piece of software (ActiveX, Add-on, etc.) in the client computer.

That said, you can do this trick

response.redirect("mailto:[email protected]?subject=Hello&body=Place body here")

This will open the mail program configured in the client (it will depend on how the client PC is configured)
Be aware that you are very limited on the length of subject and body.

Tested in Firefox 3.6, Chrome and Internet Explorer 8 (it raises a security warning)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文