CDOSYS and smarthost

D

Dune

I'm trying to send an email from my ASP page using
CDO.Message and CDO.Configuration. I couldn't get this to
work for ages and all my emails ended up in
inetpub\mailroot\queue.

I'm behind a firewall and finally figured out that i have
to set the smarthost field for the SMTP Virtual Server in
IIS to get any emails to send. All good, the emails get
sent.

The part that confuses me is that in my code, no matter
what i set the cdoSMTPServer field for the
CDO.Configuration object to, it always works. I guess it's
using the smarthost field in the SMTP Virtual Server to
get the name of the server to use...but how will this all
work out on a different computer??

(What i would really like is for the code to use the
server specified in the cdoSMTPServer field instead of
relying on the configuration of the SMTP Virtual Server.)

Cheers.
 
D

Dune

here's my code:

Dim iMsg
Set iMsg = Server.CreateObject("CDO.Message")

Dim iConf
Set iConf = Server.CreateObject("CDO.Configuration")

Dim Flds
Set Flds = iConf.Fields
Flds("cdoSendUsingMethod") = 2 'cdoSendUsingPort
' this is actually set to the server name in my code
Flds("cdoSMTPServer") = "smarthostServerName"
Flds("cdoSMTPServerPort") = 25
Flds("cdoSMTPAuthenticate") = 0 'cdoAnonymous
Flds.Update

With iMsg
Set .Configuration = iConf
.To = Request.Form("txtEmail")
.From = "(e-mail address removed)"
.Sender = "(e-mail address removed)"
.Subject = "QVNZ - Reset Password"
.TextBody = "This is a test email."
.Send
End With

Set iMsg = Nothing
Set iConf = Nothing
 

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

Similar Threads

cdosys with windows 2003 error 3
CDOSYS SMTP 1
CDOSYS send email with ASP 9
CDOSYS - Newbie 5
Error 8004020f when using CDOSYS 2
Problem sending mail (CDOSYS) 2
Problems with CDOSys and Win2K 1
CDOSYS forms 12

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top