开发者

Email a Div from a form

开发者 https://www.devze.com 2022-12-20 00:40 出处:网络
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

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 email div content in php


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


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/

0

精彩评论

暂无评论...
验证码 换一张
取 消