Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-26-2012, 10:58 AM   PM User | #1
funkyspirit
New to the CF scene

 
Join Date: Feb 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
funkyspirit is an unknown quantity at this point
Sending CDO email messages using SSL

Hello,

I have an ASP form that sends emails using CDO and HMail server. So far, I have done this using port 25 and a clear connection. However, I now need to use SSL to send the emails.

I have configured HMail server to use port 465 and ssl. I have also changed the code of the CDO message to use ssl.

However, when I try to send a message an error 500 occurs.

The code for the CDO message is below:

If request.Form("submit") <> "" then

Set myMail=CreateObject("CDO.Message")
myMail.Subject="xxxxxxxxx"
myMail.From=Request.Form("email")
myMail.To= "xxxxxxxxx"
myMail.TextBody = "Name:"& Request.Form("name")& vbcrlf & vbcrlf & _
"Email:" & Request.Form("email") & vbcrlf & vbcrlf & _
"Telephone:" & Request.Form("telephone") & vbcrlf & vbcrlf & _
"Location:" & Request.Form("location") & vbcrlf & vbcrlf & _
"Other location:" & Request.Form("other_location") & vbcrlf & vbcrlf & _
"Comments:" & Request.Form("comments")
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="127.0.0.1"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=465
MyMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing

What I am doing wrong?

Thank you.
funkyspirit is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:18 AM.


Advertisement
Log in to turn off these ads.