cdo.message cdoReturnReceiptTo

M

Milton Snider

I tried using the following vbscript to turn on the cdoReturnReceiptTo and
recieved an error: http 500 server error. When I remove the code the script
works fine. This is running on an IIS 5 server in win2000 server. Can
anyone tell me how to make the reciept function work? The BCC doesn't work
either. Can I put more than one address in the .To parameter? Here is the
code.

<html>
<%
Dim MyMail
Dim mypath
mypath = Server.MapPath(Application("FrontPage_VRoot")) & "\email.htm"
Set MyMail = Server.CreateObject("CDO.Message")
With MyMail
.Fields(cdoDispositionNotificationTo) = "[email protected]"
.Fields(cdoReturnReceiptTo) = "[email protected]"
.Fields.Update
End With

MyMail.From = "[email protected]"
MyMail.To = "[email protected]"
MyMail.Bcc ="[email protected]"
MyMail.Subject = "Bankruptcy CMECF Operations Forum Registration"
MyMail.TextBody = "TEST EMAIL" & vbCrLf & "Line # 2!" & vbCrLf
MyMail.AddAttachment mypath
MyMail.Fields.Update()
MyMail.Send()
Set MyMail = Nothing
%>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Email and Update</title>
</head>

<body>

</body>

</html>
 
J

Jon Spivey

Hi Milton,

How are you including the cdo constants? Like this?

<!--METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->

Try the receipt part like this

Set cdoConfig = CreateObject("CDO.Configuration")
Set cdoMessage = CreateObject("CDO.Message")

With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "smtp.you.com"
.Update
End With

With cdoMessage
.Fields(cdoDispositionNotificationTo) = "[email protected]"
.Fields(cdoReturnReceiptTo) = "[email protected]"
.Fields.Update
' etc

This certainly works for me
 
Top