catalyst2 community forums  

Go Back   catalyst2 community forums > Support > Scripting Support

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 01-04-2006, 12:56 PM   #1 (permalink)
Ali
Registered User
 
Join Date: Dec 2003
Location: Dundee
Posts: 42
ASP / Cdonts

Hi there,

I heep having "Access denied" errors when trying to send email with the following code:

<%
Set myMail = CreateObject("CDO.Message")
myMail.Subject = "test"
myMail.From = "notify@alicholic.co.uk"
myMail.To = "alicolville@gmail.com"
myMail.HTMLBody = "Test message"
myMail.Send
set myMail = nothing
%>

I get access denied on the .Send

I have created the email account notify@ in helm.

An ideas?!

Ali
__________________

Ali

www.AliColville.com
Ali is offline   Reply With Quote
Old 01-04-2006, 01:00 PM   #2 (permalink)
Ali
Registered User
 
Join Date: Dec 2003
Location: Dundee
Posts: 42
Ooops the link is actually:

myMail.From = "notify@alicolville.co.uk"
__________________

Ali

www.AliColville.com
Ali is offline   Reply With Quote
Old 01-04-2006, 01:00 PM   #3 (permalink)
Administrator
 
Jacob's Avatar
 
Join Date: May 2003
Posts: 1,299
Try something like:

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.TextBody="This is a message."
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") _
="mail.yourdomain.com"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing

Regards,

Jacob
Jacob is offline   Reply With Quote
Old 01-04-2006, 01:02 PM   #4 (permalink)
Ali
Registered User
 
Join Date: Dec 2003
Location: Dundee
Posts: 42
Tried your code.

Keep getting:

CDO.Message.1 error '80040213'

The transport failed to connect to the server.

/test.asp, line 19
__________________

Ali

www.AliColville.com
Ali is offline   Reply With Quote
Old 01-04-2006, 01:03 PM   #5 (permalink)
Administrator
 
Jacob's Avatar
 
Join Date: May 2003
Posts: 1,299
You will need to go through and check the script and replace it with your own domain name etc so it is not:

"mail.yourdomain.com"
Jacob is offline   Reply With Quote
Old 01-04-2006, 01:05 PM   #6 (permalink)
Ali
Registered User
 
Join Date: Dec 2003
Location: Dundee
Posts: 42
Ooops... how blonde... never noticed that!

That works mate! Thanks a lot!
__________________

Ali

www.AliColville.com
Ali is offline   Reply With Quote
Reply

Thread Tools
Display Modes 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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:20 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.