By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,729 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,729 IT Pros & Developers. It's quick & easy.

Sending PHP forms via HTML email

P: n/a
How do I sent content of a PHP form via HTML email?

For example, fields $name, $city, $state, $phone, $location

to HTML:

<p>Congratulations $name from $city, $state with the phone # $phone .
You now get an expense paid trip to $location .

And that HTML outputted in email..so someone checks their email,they
have an HTMl certificate generated from a form in PHP.
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
sk
The PEAR Mail_mime module is pretty great for this. It makes generating
even multipart/alternative mail with inline image attachments easy.

Head over to http://pear.php.net

--
Steve Koppelman
http://www.hatless.com/

ph**********@hotmail.com wrote:
How do I sent content of a PHP form via HTML email?

For example, fields $name, $city, $state, $phone, $location

to HTML:

<p>Congratulations $name from $city, $state with the phone # $phone .
You now get an expense paid trip to $location .

And that HTML outputted in email..so someone checks their email,they
have an HTMl certificate generated from a form in PHP.


Jul 17 '05 #2

P: n/a
Unfortunately it requires installing Pear, more than I bargained for.
Any other alternative?

sk <st***********@hatless-dot-com-without-the-spam.com> wrote in message news:<nk3kb.579409$Oz4.558595@rwcrnsc54>...
The PEAR Mail_mime module is pretty great for this. It makes generating
even multipart/alternative mail with inline image attachments easy.

Head over to http://pear.php.net

--
Steve Koppelman
http://www.hatless.com/

ph**********@hotmail.com wrote:
How do I sent content of a PHP form via HTML email?

For example, fields $name, $city, $state, $phone, $location

to HTML:

<p>Congratulations $name from $city, $state with the phone # $phone .
You now get an expense paid trip to $location .

And that HTML outputted in email..so someone checks their email,they
have an HTMl certificate generated from a form in PHP.

Jul 17 '05 #3

P: n/a
sk
ph**********@hotmail.com wrote:
Unfortunately it requires installing Pear, more than I bargained for.
Any other alternative?
1. Find an HTML email somewhere in your inbox.

2. View source.

3. Look at how the message is formed.

4. Form a message that resembles it structurally. For the bulk of the
body, "heredoc" syntax is your friend. What you want to do is build the
body as one long string, with the variables you want inserted in the
appropriate places, just like you would if you were making a web page.
Then pay attention to the headers that define it as a MIME message with
HTML contents, as well as any MIME separators in the message itself.
You'll need to add those headers using the API of whatever mail call you
use, and add the in-message separators manually to the body of the message.

5. Send the mesaage.

6. Make sure it arrives and displays properly in a couple of
representative mail programs. Some mail programs are more forgiving of
little MIME mistakes than others.

6. After you do this a few times with convoluted, cranky code to get the
headers and separators working just right, see if you can use PEAR's
Mail_mime in the future. It's installed by default with newer releases
of PHP, and isn't too difficult to install otherwise as long as you have
control over php.ini. If your web host can't or won't support PEAR, ask
yourself why.

sk <st***********@hatless-dot-com-without-the-spam.com> wrote in message news:<nk3kb.579409$Oz4.558595@rwcrnsc54>...
The PEAR Mail_mime module is pretty great for this. It makes generating
even multipart/alternative mail with inline image attachments easy.

Head over to http://pear.php.net

--
Steve Koppelman
http://www.hatless.com/

ph**********@hotmail.com wrote:
How do I sent content of a PHP form via HTML email?

For example, fields $name, $city, $state, $phone, $location

to HTML:

<p>Congratulations $name from $city, $state with the phone # $phone .
You now get an expense paid trip to $location .

And that HTML outputted in email..so someone checks their email,they
have an HTMl certificate generated from a form in PHP.


Jul 17 '05 #4

P: n/a
Hello,

On 10/18/2003 01:12 AM, ph**********@hotmail.com wrote:
How do I sent content of a PHP form via HTML email?

For example, fields $name, $city, $state, $phone, $location

to HTML:

<p>Congratulations $name from $city, $state with the phone # $phone .
You now get an expense paid trip to $location .

And that HTML outputted in email..so someone checks their email,they
have an HTMl certificate generated from a form in PHP.


You may want to try this class that lets you compose and send HTML
messages properly:

http://www.phpclasses.org/mimemessage
--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.