Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using CDONTS to send mail - and failing!

Status
Not open for further replies.

Suzypud

Programmer
May 15, 2002
1
GB
Hi,

I'm trying to add an email alert to an asp script which enters form data into a database. Basically I have had a request that an email be sent out everytime someone fills in the form. I've tried various things that haven't worked and the latest effort is using CDONTS. It doesn't create an error message, but no email has arrived!! Can anyone either tell me what's wrong with my code, or suggest why it wouldn't work?

Thanks

Suzy

Code:

'Lets see if we can send an email to say form has been filled in ...

Set Mail = Server.CreateObject("CDONTS.NewMail")
Mail.to="suzy.shipman@bbsrc.ac.uk"
Mail.from=request.form("email")
Mail.Subject="A new GM Worker has been added"
Mail.Body="Testing email works"
Mail.Send
Set Mail=nothing

 
Hi Suzy,

I use CDONTS in one of the sites I work with and have noticed the following difference between your code and mine:
Code:
Set Mail = Server.CreateObject("CDONTS.NewMail")
whereas I use:
Code:
Set objMail = CreateObject("CDONTS.NewMail")
Hope this helps
Tony
 
i believe it's
Set objMail = CreateObject("CDONTS.NewMail")
for vb script files and
Set objMail = Server.CreateObject("CDONTS.NewMail")
for ASP pages.
Have you tried hard coding an email address?
Do you have control of the server you're testing it on?
Have you tried using (from memory) CDO.Configuration and CDO.Message objects?
codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
<insert witticism here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top