开发者

Edit an email before sending

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 = "abc@xyz.com"

objNewMail.Cc = "def@stu.com"

' 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


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:name@hotmail.com?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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜