...

View Full Version : Email - Plain Text Table Simulation



Snetty
08-21-2007, 01:00 PM
Hi guys,

I'm currently working on an ecommerce project that requires the system to send out reciept emails after each order has been completed. I notice in own store email receipts that they're all plain-text, which is fine by me, but they also manage to format their text so that it appears as if there are tables in there for listing the products i've bought.

Can anyone tell me if there is perhaps a php function that does this, or atleast how I'd got about writing a function that would work out the correct spacing for this?

Pennimus
08-21-2007, 01:22 PM
You just send mail using the mail() (http://uk.php.net/function.mail) function and specify it to be in HTML format in the additional headers.

Snetty
08-21-2007, 01:24 PM
no, i want to send it as plain text. The receipt emails I've had from stores I've used all use plaintext so I know it's possible.

I think I've figured it out anyway, all I have to do is test each value length and store the biggest one for each column, then run through the array again and use str_pad() to set the spacing.

Inigoesdr
08-21-2007, 04:13 PM
mail() uses plain text unless you specifically build an HTML e-mail.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum