tags:

views:

33

answers:

2

We have a form that is submitted and the results displayed to the user using php. As far as I am aware there is no way of styling a cgi email, nor a php email to look like the html page. I have tried with php (which I am not familiar with) but as far as I can see it will not work because there are other php captions inside what would be emailed from the submission of the form.

The easiest way would be to email the contents of the div if that is possible. I found and AJAX script written by Jonathan Sampson. Although this sends an email, rather than email the div I receive the from, to, subject etc... but the content simply says null.

The script by Sampson is here. Does anyone know how to make it work http://stackoverflow.com/questions/1827767/email-div-content-in-php

A: 

I don't necessarily know how to make this script work, but I do know my way around PHP email forms. What exactly are you attempting to send? Can you give me an example of the form?

If the content is not overly difficult, I would simply send it as an HTML email or with simple PHP mail formatting.

Craig

gamerzfuse
It is more than likely I'm overcomplicating the issue. You will find and example of what I meant by this link. Click on where it says Basket/Checkout once the page has loaded, and then fill in details to let it submit. It will then load a php page called booking. The information in the div 'booking_quote' is the information that I want to be sent to the user by email and to the sales team.http://www.divethegap.com/scuba-diving-programmes-dive-the-gap/programme-pages/dahab-diver/dahab-diver-beginners.php
Robin I Knight
If it is a simple PHP form, you can definitely send the data in a very nice format like: *Heading*: Content or even in paragraphs, etc. If that is what you are looking for?
gamerzfuse
A: 

I'm not sure exactly what you're asking. Sampson's example works fine. Ofcourse he didn't provide neat files for you to work with, but I think you're overcomplicating the issue.

Problem: You want to send an email that is styled with HTML? There's no need to bring jQuery and ajax and DOM into this. You just need to format your email with simple string manipulation to look good on an email. Check this page out :

Simple example: http://phpform.net/html_mail.php

That sends a basic css styled email. The most important part there is the Content-type: text/html; header

A bit more advanced

http://www.phpbuilder.com/columns/kartic20000807.php3?page=2

Skip to the section about sending Multipart emails

Demo: http://css-tricks.com/sending-nice-html-email-with-php/

Stanislav Palatnik
It is more than likely I'm overcomplicating the issue. You will find and example of what I meant by this link. Click on where it says Basket/Checkout once the page has loaded, and then fill in details to let it submit. It will then load a php page called booking. The information in the div 'booking_quote' is the information that I want to be sent to the user by email and to the sales team.http://www.divethegap.com/scuba-diving-programmes-dive-the-gap/programme-pages/dahab-diver/dahab-diver-beginners.php
Robin I Knight