Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with CDOSys Email Script

Status
Not open for further replies.

Kris912

Programmer
Jul 29, 2005
27
US
Hi,

I am trying to use a CDOSys email script that is failing at the .send line. I am used to using ASP Email so I am not familiar with the quirks that come with CDOSys.

Here is the script I am using...

<%

Const cdoSendUsingMethod = _
"Const cdoSendUsingPort = 2
Const cdoSMTPServer = _
"Const cdoSMTPServerPort = _
"Const cdoSMTPConnectionTimeout = _
"Const cdoSMTPAuthenticate = _
"Const cdoBasic = 1
Const cdoSendUserName = _
"Const cdoSendPassword = _
"
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields

' Get a handle on the config object and it's fields
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields

' Set config fields we care about
With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "mail.graphicmemory.com"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "jgervais"
.Item(cdoSendPassword) = "tR48a4sq"

.Update
End With

Set objMessage = Server.CreateObject("CDO.Message")

Set objMessage.Configuration = objConfig

With objMessage
.To = "Display Name <webmaster@graphicmemory.com>"
.From = "Display Name <email>"
.Subject = "Feed back from Graphic Memory Website"
.TextBody = vbcrlf & "~~~~~~~~~~~~~~~~~~~~~~~~~" & vbcrlf
.TextBody = .TextBody & "Feedback from your Web Site" & vbcrlf
.TextBody = .TextBody & "~~~~~~~~~~~~~~~~~~~~~~~~~" & vbcrlf & vbcrlf
.TextBody = .TextBody & "Name: " & replace(request("Name"),"'","''") & vbCrLf
.TextBody = .TextBody & "EMail: " & replace(request("Email"),"'","''") & vbCrLf
.TextBody = .TextBody & "Day Phone: " & replace(request("Day_Phone"),"'","''") & vbCrLf
.TextBody = .TextBody & "Evening Phone: " & replace(request("Evening_Phone"),"'","''") & vbCrLf
.TextBody = .TextBody & "Other Phone: " & replace(request("Other_Phone"),"'","''") & vbCrLf
.TextBody = .TextBody & vbCrLf
.TextBody = .TextBody & "Inquiry: " & replace(request("Inquiry"),"'","''") & vbCrLf & vbCrLf
.TextBody = .TextBody = "SMTP Relay Test Sent @ " & Now()
.Send
End With

Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
%>

I would appreciate any guidance you could lend me--Thanks so much!!

Kris912 :)
 
That's the problem there is none. It just notes the line number which happens to be the .send line.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top