Jump to content

Emailing through PHP question


irrelevantjoker

Recommended Posts

Hey all,

i'm designing an order system through php, the orders get emailed to my account and then the customers are taken to the payment system

however, if there is an error and the email doesn't get sent and the customer pays for it, i'll have no idea what they paid for

is there some form of code to make sure the email was sent successfully before continuing? and if the email fails, redirect the customer to another page?

cheers,  ;D

  - Joker
Link to comment
Share on other sites

You could use a try and catch block, catching exceptions an handling them effectively if you have php5 available. 

Otherwise, doing
mail() OR die()
would work too, but that would just notify the user that the mail wasn't sent. 

The normal way of handling this is to store the information in a database so even if the mail is not sent, it still exists in the database.  I'm not sure if this is feasible or not, but could be a good option.
Link to comment
Share on other sites

it would take you 10 minutes to build a table within a database
it'll take you 5 minutes to program something to database, some form of identification for the orders, even if you just database there email address, and some other stuff.  What would take taht long.  10-20 minutes of extra work.THen you atleast have a list of emails of buyers, and you can match that against your emails to make sure your getting them all.  It would only take you 5 minutes
create 1 table called userinfo

1 field called
id - int(30) autoinc, prim
email - varchar - 200
that's it
then in the script
take the email address and insert it into the table
$insert = "INSERT INTO userinfo (email) VALUES ('$email');";
mysql_query($insert);
that's it in it's basic form you can build onto it from there, you can triplet he functionality in less that 30 minutes, that took 2 seconds.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.