CDOSYS help needed

C

crushando

hi

i'm new to ASP and have to deal with some email scripting at the very
start.I've collected some script pieces from a variaty of tutorial
pages but haven't been able to send any mails yet. I'm pasting the
latest version of the code:

<%

Dim sMsg
Dim sTo
Dim sFrom
Dim sSubject
Dim sTextBody

sTo = "(e-mail address removed)"
sFrom = "(e-mail address removed)"
sSubject = "Insert here your subject text"
sTextBody = "Insert here your plain body text"

Dim objMail, oMailConfig

'Create the mail object
Set objMail = Server.CreateObject("CDO.Message")
Set oMailConfig = Server.CreateObject ("CDO.Configuration")

oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "localhost"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 60
oMailConfig.Fields.Update

Set objMail.Configuration = oMailConfig
'Set key properties
objMail.From = sFrom
objMail.To = sTo
objMail.Subject= sSubject
objMail.TextBody = sTextBody

'Send the email

objMail.Send

'Clean-up mail object
Set objMail = Nothing
%>

As I said before i'm very new to ASP so i might be even missing a very
basic stuff. I've tried the code without the configuration part as well
but nothing has changed. Actually it seems that the problem is about
objMail.Send part. When I comment it the script runs fine but when I
activate it the page is not accessible (that's another problem that
i've come up with ASP. There's no error messages but a page error.
Should I catch an exception to see what's wrong or do I need to check
some other stuff?)
I wasn't sure about the VB syntax style so I also tried objMail.Send()
My script is running on IIS 6 server so I don't think there's a support
problem with CDOSYS

Any help and/or advise is appreciated muchly
Thanks :)
 
K

Kyle Peterson

there are a lot of different ways to send email using cdosys, these article
goes over that in detail
http://www.powerasp.com/content/new/sending_email_cdosys.asp

Your just trying one... and by saying your email server is "localhost" that
may or may not be valid.

Ultimately you have to ask your server admins what settings you should be
using to send an email with CDOSYS.
If it is your local server that knowledge all rides on you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,069
Latest member
SimplyleanKetoReviews

Latest Threads

Top