Emailing Receipts

The final.php script includes email_receipt.php, whose role it is to email a receipt to the customer. Because a lot of information could be in this receipt (itemizing multiple products), sending an HTML receipt is a logical choice. Considering that some people like HTML email and others don’t, the professional solution is to send an email that’s viewable in either HTML (Figure 10.18) or plain text format (Figure 10.19). That’s what email_receipt.php will do.

Figure 10.18

image

Figure 10.19

image

Tip

You can also use the PEAR Mail_Mime ...

Get Effortless E-Commerce with PHP and MySQL now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.