Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Wild n Crazy checkout_process.php email problem


pjakobs

Recommended Posts

Posted

Ok, go grab a cup of coffee and make yourself comfortable, this is a long email with an odd problem that has been plagueging(sp?) me today. [shakes fist at oscommerce]

 

We are using oscommerce with authorize.net. I am having an odd problem with the checkout process that's driving me crazy. Here's what the user sees:

 

They place an order in their basket, go through the checkout, put in their credit card number, get to the confimation page, click the submit button to confirm. Then, they get an Internal Server Error. A few minutes later they get the confirmation email with their order.

 

The odd thing is that the order goes through to authorize.net ok and the server error is on our server after authorize.net sends it back to us. Unfortunately we're with GoDaddy and do not have access to the server error logs. [shakes fist at GoDaddy] I've done some trouble shooting on my own and figured out that the error is on checkout_process.php at the point that it calls the tep_mail function to send a confirmation email. The way I figured it out is by putting some fwrite statements into checkout_process.php at various points to make it write to my own log file so that I could see when the last log message gets written. Here's an excerpt:

 

$erdata="about to send email\n";
if (!fwrite($file_handle, $erdata)) { echo "Cannot write to file"; }
tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
$erdata="email has been sent\n";
if (!fwrite($file_handle, $erdata)) { echo "Cannot write to file"; }

 

The log file gets the "about to send email message" but not the next one. That tells me that the problem is in tep_mail, right? The weird thing is, that although it generates an internal server error, the email confirmation email does get sent.

 

So, I've gone into general.php and done some testing with the tep_mail function. Again, I've added fwrites at various points so that I would know where it fails, and it doesn't. It seems to do everything ok. But the server error still appears, and it doesn't seem to get back to checkout_process.php So it's failing, but it isn't. But it is! But it isn't! But it is! [bangs head on keyboard]

 

If I comment out the tep_mail line on checkout_process.php I stop getting the server error, but of course the user doesn't get the confirmation email then. I would like to be able to send these emails.

 

Any idea on what could be going on? I swear I'm not smoking anything funky! I do have a cold, so maybe my muddled brain just isn't functioning properly today.

 

Merci Buttercups!

 

Paula

Posted

They're clicking the Confirm button to send them to authorise.net and this is where the error occurs, right?

 

Maybe it's authorise.net that's the problem.

 

Or maybe just your basic e-mail settings in osCommerce. If you have it set to Use MIME HTML set it to 'false' - worth a try! I would also have Check E-mail Addresses Through DNS set to 'false'. Basically, cut everything to do with e-mail back to a basic, no frills set up.

 

Vger

Posted

Here's another common pitfall:

 

Check "Admin/Configuration/My Store/Email From".

 

Many think this is the Store Name and put things like "My Store" in it—this will break the sendmail command.

 

Instead put the EMAIL ADDRESS in here that your store should us as the "From:" email address (it CAN be different from the other one, yes).

I don't want to set the world on fire—I just want to start a flame in your heart.

 

osCommerce Contributions:

Class cc_show() v1.0 – Show Credit Cards, Gateways

More Product Weight v1.0

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...