473,385 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

CDOSYS and smarthost

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.
Jul 19 '05 #1
2 3158
Hmm, sorry, I answered in the wrong place.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Dune" <an*******@discussions.microsoft.com> wrote in message
news:08****************************@phx.gbl...
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.

Jul 19 '05 #2
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 = "he******@quotable.co.nz"
.Sender = "he******@quotable.co.nz"
.Subject = "QVNZ - Reset Password"
.TextBody = "This is a test email."
.Send
End With

Set iMsg = Nothing
Set iConf = Nothing

-----Original Message-----
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'susing 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.
.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paxton | last post by:
Is it necessary to set field configurations for CDOSYS? I have yet to recode all my existing uses of CDONTS over to CDOSYS. In most of the sample code I've seen on the usual ASP sites, there is...
2
by: dmalhotr2001 | last post by:
Hi, I'm using windows 2003 with asp. However I'm having problems sending email using the cdosys object. My code is below and I don't believe its the code but on the send command. <% dim...
9
by: tshad | last post by:
This is a problem that we saw before on our asp site, but don't know how to fix it. We are seeing it on our .net site also. We have our email sending from our Windows 2003 server with exchange...
14
by: Neil Ginsberg | last post by:
I am using VBA/Access to send SMTP mail using CDO. I set a reference to "Microsoft CDO for Windows 2000 Library" (cdosys.dll). Everything works fine, both on my PC and on another PC. However, on...
24
by: Manuel | last post by:
Is it possible to embed an image, like a company logo in a CDOSYS generated message? If yes, I´ll apreciate some code sample. I´ve been able to format messages in html the way I like, but I...
8
by: Akbur | last post by:
Dear all, I'm having major issues sending an email from my ASP.NET app. I'm getting a "Could not create 'CDO.Message' object". When I did a search for cdosys.dll in \win_location\system32, I...
2
by: mister-Ed | last post by:
Trying to use cdosys mail, but this is giving me an "no such object" error. the hosting company is not much help, but their list of components offered does include cdosys mail: <form...
8
by: worldofrugs | last post by:
I'm hosted on a shared server with Godaddy.com... I have several forms on my website that all use the same ASP file to send out my forms.. It worked fine for a long time, but now the forms send to...
9
by: paulmitchell507 | last post by:
I have a file called email2.asp which I am using to mail data obtained from a SQL query. I would like to pass the holiday_ID value in the querystring attached to the end of the URL. It all works...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.