Forums

No e-mail results = No DB connection?

pthesis 12 May, 2010
I've noticed that when I set "E-mail results" to No, I don't get an entry in the table I've set under "DB Connection". It works fine when "E-mail results" is set to Yes. Under "DB Connection" I've set it to "Before E-mail".

Is it possible to have the form write to the database even if no e-mails are sent out?


Thanks!
GreyHead 12 May, 2010
Hi pthesis,

Yes, illogically, set the DB Connection to 'After Email' which is the default.

The 'Before Email' code isn't run if Send Emails is set to 'No'

Bob
pthesis 13 May, 2010
Thanks Bob.

Is it possible to have the DB connection independent of the e-mail process?

Here's the problem I'm having: sometimes e-mails get sent out, sometimes they don't. I think it's a problem on the hosting provider's end, but in general, as a more robust solution, it makes more sense to have the form write to the database regardless of whether the e-mail goes out successfully or not.

Right now, whether it's set to "Before e-mail" or "After e-mail", the database doesn't get written to if the e-mail doesn't get sent out (for any reason).
GreyHead 13 May, 2010
Hi pthesis,

The two aren't linked except in the sequence they run in. If the DB Connection is failing then something else is going wrong.

You can set the DB Connection to Before Email provided that Send Emails is set to Yes.

It is highly unlikely that emails are sometimes sent and sometimes not unless you are using Dynamic fields and not validating the contents.

It's much more likley that eamils are being sent but not delivered correctly becsue they are ending up in a spam filter or folder.

Bob
pthesis 13 May, 2010
What's happening is that sometimes I'm getting an SMTP error, so the e-mails aren't getting sent out. And every time that happens, an entry doesn't get made into the database either.

I'm talking to the hosting company about the SMTP error, but I would like it so that even if the e-mail doesn't get sent out the database still gets updated with the new entry.

I only made the inference that the e-mails and DB connection were connected because I noticed they were both succeeding and failing together every time. I also had some code under Form Code > On submit after e-mail, which wasn't executed if the e-mail failed to deliver.

The way things stand right now are that under DB connection I have it set to "Before e-mail" but I'm still noticing that every time an e-mail isn't sent out (due to SMTP error), the database doesn't get updated either. What would you suggest?
GreyHead 13 May, 2010
Hi pthesis,

Best solution is to change to a different SMTP server.

If the site is behaving as it should then then a failed email shouldn't prevent the data being saved to the database.

Bob
pthesis 17 May, 2010
Hi Bob,

Is it possible to debug the form via e-mail? I don't want the diagnostic output being displayed to the user. Instead can I have it sent to me by e-mail everytime the form is used?


Thanks.
GreyHead 17 May, 2010
Hi pthesis,

Not without hacking the code to do that.

Bob
This topic is locked and no more replies can be posted.