Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2005
    Posts
    94
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Email - Plain Text Table Simulation

    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?

  • #2
    Senior Coder
    Join Date
    Jul 2005
    Location
    UK
    Posts
    1,051
    Thanks
    6
    Thanked 13 Times in 13 Posts
    You just send mail using the mail() function and specify it to be in HTML format in the additional headers.

  • #3
    New Coder
    Join Date
    May 2005
    Posts
    94
    Thanks
    4
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    mail() uses plain text unless you specifically build an HTML e-mail.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •