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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Occasional Missing CDONTS Emails

Status
Not open for further replies.

PaulHInstincticve

Programmer
May 31, 2006
45
GB
I have a script which generates emails from a web page during an ordering process. The script is part of a function where parameters such as the from address, to address, subject and message body are passed to the function to generate the CDONTS email. I have about 12 customers using this application without any problems at all but one customer who is reporting 'occasional' missing emails. The application is an event booking system for a membership. At the end of the process a confirmation email is generated to

The member
The Office
The Office on a backup email address

When the email is sent to the member the to address is obviously the members email address and the from address is the office email address which is a valid mailbox name on the webserver. When the office copy is generated, however, the from address used is the member email address (in order that the office can just hit 'reply' and the 'to' address is the office mailbox on the webserver that is sending the email.

Typically for the customer experiencing problems they might get 30 emails through successfully then one will just disappear into nowhere, they might get another successfully and then another missing one. In most (but not all cases) the member copy does get through though.

We have raised this with the customers ISP (Fasthosts who host several other of our customers who do not experience these problems) and we have asked for access to mail logs to see if we can trace what is going wrong (particularly as the webmaster involved was very suspicious of antispam features initially although when I added debug code so that we also got a copy of the email we got all but the ones that the office missed!). The ISPs reaction was that 'it is always better to use a from address which is a valid mailbox on the server rather than the members address'. We can see where they are coming from here but do not want to lose the 'reply' functionality and we question why 95% or more emails are getting through if we are doing it wrong. Afterall computers do as they are told and are consistent, we are not seeing consistency here, surely they should all fail if this were the case? They are also telling us to use JMAIL instead of CDONTS. I appreciate that this is an alternate mail system but wish to avoid unnecessary development if it is not guaranteed to solve the problem, afterall its not as though we can write a simple program to test a JMAIL solution because the fault happens so occasionally it is impossible to replicate.

Has anyone else had any problems like this? Would you agree with Fasthosts policy on the 'from' address or are they clutching at straws? Is JMAIL significantly superior to CDONTS? Any help really appreciated. The code in my function is copied below

Sub Sendemail (cto, csubject, cfrom, cbody)
' send a cdonts email
Dim objmail
Set objMail = Server.CreateObject("CDONTS.Newmail")
objMail.To = cto
objMail.Subject = csubject
objMail.From = cfrom
objMail.Body = cbody
objMail.Send
Set objMail = Nothing
end sub

Paul
 
Hi Paul, yes I do agree with the ISP's policy, this is pretty standard. Why dont you add a reply to within the mail header?

Code:
Sub Sendemail (cto, csubject, cfrom, cbody)
' send a cdonts email
Dim objmail
Set objMail         = Server.CreateObject("CDONTS.Newmail")
objMail.To         = [customer email & Office email]
objMail.Subject     = csubject
objMail.From         = [office email address]
objMail.Value("Reply-To") = [customer email]
objMail.Body         = cbody
objMail.Send
Set objMail = Nothing
end sub

Cheers

Nick
 
"it is always better to use a from address which is a valid mailbox on the server rather than the members address"
Although this is true, it is usually an all or nothing situation... not the intermittant failures you describe.


We can see where they are coming from here but do not want to lose the 'reply' functionality

You can set the REPLY-TO header to another address to fix this issue although you might need to switch to Microsoft's newer CDO.Message instead of CDONTS to do it. CDONTS is no longer supported by MS but the conversion to CDO will be easier than conversion to a third party mail system.
 
Nick,

Thanks for that, what an obvious idea! Had not realised the basic CDONTS email system was quite so advanced ;-) Shame the ISP could not be as helpful! Will make the change immediately and hopefully this should do the trick. Still baffled why its just this one account though and its only the odd email that goes astray and not all of them. Maybe computers are just not as consistant as I had assumed. Thanks again

Paul
 
Also you didn't mention if the missing messages were turning up in the \mailroot\badmail or \mailroot\queue folders.
 
Sheco,

Thanks for that. Will look into CDO (I assume there is a line for line simple replacement for the above CDONTS code?). Regarding \mailroot\badmail etc, is that something we would have access to on a shared server with someone like Fasthosts or would we need to contact the ISP to look at that?

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top