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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.