Page 1 of 1

sending the online order through your email

Posted: Wed Aug 30, 2006 10:54 am
by magicbyte
hello everyone. I'm beggining to learn php+mysql, i already purchased this book from luke welling and laura thomson titled "PHP and MYSQL web development" and i have a few questions.

Im planning to design a website where users can have a reservation+total for the items they want to buy, only reservation not purchase online. I want to be able to receive their reservations via email, so that i can print them when they come.

1st question: Is it possible to send an email containing their formatted document that's ready to print?
2nd question: What languages are involve in this kind project?
3rd question: What do you think??

Thanks in advance guys.. :roll:

Posted: Wed Aug 30, 2006 11:45 am
by Christopher
I am assuming that for your #1 you mean: Is it possible to send an email containing their formatted document that's ready to print?

The answer is yes, and you have a couple of different ways to go depending on the data. Obviously if you send a simple text email and pad with spaces you can do some degree of formatting that will show up when printed. The next level would be to send a HTML email which could have better layout, colors and images. For that I would recommend using an existing emailing PHP library such as SwiftMailer or phpMailer because sending properly formed HTML email is harder than you think. Finally for the most precise control over the layout you could generate a PDF file and attach that to the email. There are a number of PDF generation libraries in PHP, and you would use on of the previously mentioned email libraries to create the email with an attachment.

Posted: Wed Aug 30, 2006 7:30 pm
by magicbyte
arborint wrote:I am assuming that for your #1 you mean: Is it possible to send an email containing their formatted document that's ready to print?

The answer is yes, and you have a couple of different ways to go depending on the data. Obviously if you send a simple text email and pad with spaces you can do some degree of formatting that will show up when printed. The next level would be to send a HTML email which could have better layout, colors and images. For that I would recommend using an existing emailing PHP library such as SwiftMailer or phpMailer because sending properly formed HTML email is harder than you think. Finally for the most precise control over the layout you could generate a PDF file and attach that to the email. There are a number of PDF generation libraries in PHP, and you would use on of the previously mentioned email libraries to create the email with an attachment.
Yeah that's what i mean. Thanks for your time and reply, i really appreciate it. Now i have to read the rest of the book to implement the website im planning. Thanks again. :D :D :D