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 = "te**@blabla.com"
sFrom = "cr***@bonbon.com"
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 :)