NetTalk Central

Author Topic: Issue with email not always getting sent  (Read 3459 times)

bekeland

  • Newbie
  • *
  • Posts: 37
    • View Profile
Issue with email not always getting sent
« on: June 18, 2010, 08:10:23 AM »
Using NetTalk 4.30, I have an issue on my web server where e-mail is not consistently getting sent.  The app is a web store, they are all secure pages.  In the last step I have a NetWebForm where I have embeds in Generate Form | 1 Start, and Generate Form | 9 After </script>.  The first embed has a call to a local routine Do CreateNewOrder, where quite a bit of stuff is going on with writing the order to my files updating daily summaries and so on.  The second embed is the call to my e-mail window: OrderConfEMail(loc:emailto, loc:emailtext, loc:emailhtml,0,0).  Most of the time this all works fine.

However, there are times where I am not getting the confirmation e-mail, but I do have the order written.  The way it is coded is that if there is an order written out, the e-mail code will execute.  I should always get an e-mail on an order.  I originally had the call to the e-mail in the same embed, the 1 Start, but it worked even less regularly then, so I moved it to the end of the Generate Form embeds and it has worked better.  But I need it to work all the time.

First, why does this not always work?  What else can I do to ensure the e-mail will always be sent?  I am going to add code to the ErrorTrap of the email window and see if there is something getting posted there, but wondered if anyone had anything like this and what you did about it.  It seems like there is some sort of timing issue that I can't nail down.  Thanks.

Brian Ekeland

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Issue with email not always getting sent
« Reply #1 on: June 21, 2010, 07:51:39 AM »
Hi Brian,

First problem is possibly the build you are using - 4.30 is very old, even in the NT4 stream.

However, the problem is almost certainly not in your program. Most likely your sendEmail procedure occasionally gets an error from the server. Your best option is to log the errors going through Errortrap in that procedure.

cheers
Bruce

bekeland

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Issue with email not always getting sent
« Reply #2 on: June 23, 2010, 07:34:47 AM »
I did start trapping any errors.  Here is the error, or as much of it as I'm displaying in my error list box:

Error in this Message. The remote Email (SMTP) sent error = 0 Idle Timeout - Warning...

I've gone a couple days with no errors, then I'll have a day with this error 10 times.  What is the best way to get around this?  Just try again?  Anything I can do to prevent it?  Or just have to trap and work with it?  Thanks again for the help.

Brian

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Issue with email not always getting sent
« Reply #3 on: June 25, 2010, 02:38:36 AM »
Hi Brian,

A timeout usually occurs when both sides of a conversation are waiting for the other.
So probably the next step is to log the conversation between the webserver and emailserver up to the point the error occurs.
Typically I use Debugview, called from both the .Process and .Send methods. (See the Email Client procedure in NEtDEmo for an example of what I mean).

If you do get a timeout, probably the thing to do is to close the EmailSend procedure, and then just call it again. ie "try again".

cheers
Bruce