Connecting Tech Pros Worldwide Help | Site Map

Sending PHP forms via HTML email

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:37 AM
philphanluvr@hotmail.com
Guest
 
Posts: n/a
Default Sending PHP forms via HTML email

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.

  #2  
Old July 17th, 2005, 12:37 AM
sk
Guest
 
Posts: n/a
Default Re: Sending PHP forms via HTML email

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/

philphanluvr@hotmail.com wrote:[color=blue]
> 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.[/color]

  #3  
Old July 17th, 2005, 12:38 AM
philphanluvr@hotmail.com
Guest
 
Posts: n/a
Default Re: Sending PHP forms via HTML email

Unfortunately it requires installing Pear, more than I bargained for.
Any other alternative?

sk <steve-no-spam@hatless-dot-com-without-the-spam.com> wrote in message news:<nk3kb.579409$Oz4.558595@rwcrnsc54>...[color=blue]
> 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/
>
> philphanluvr@hotmail.com wrote:[color=green]
> > 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.[/color][/color]
  #4  
Old July 17th, 2005, 12:38 AM
sk
Guest
 
Posts: n/a
Default Re: Sending PHP forms via HTML email

philphanluvr@hotmail.com wrote:[color=blue]
> Unfortunately it requires installing Pear, more than I bargained for.
> Any other alternative?[/color]

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.
[color=blue]
>
> sk <steve-no-spam@hatless-dot-com-without-the-spam.com> wrote in message news:<nk3kb.579409$Oz4.558595@rwcrnsc54>...
>[color=green]
>>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/
>>
>>philphanluvr@hotmail.com wrote:
>>[color=darkred]
>>>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.[/color][/color][/color]

  #5  
Old July 17th, 2005, 12:38 AM
Manuel Lemos
Guest
 
Posts: n/a
Default Re: Sending PHP forms via HTML email

Hello,

On 10/18/2003 01:12 AM, philphanluvr@hotmail.com wrote:[color=blue]
> 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.[/color]

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/

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.