Connecting Tech Pros Worldwide Help | Site Map

Sending PHP forms via HTML email

  #1  
Old July 17th, 2005, 01:37 AM
philphanluvr@hotmail.com
Guest
 
Posts: 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.
  #2  
Old July 17th, 2005, 01:37 AM
sk
Guest
 
Posts: n/a

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, 01:38 AM
philphanluvr@hotmail.com
Guest
 
Posts: n/a

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, 01:38 AM
sk
Guest
 
Posts: n/a

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, 01:38 AM
Manuel Lemos
Guest
 
Posts: n/a

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/

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
concatinating and sending the input type/file via ajax omerbutt answers 8 September 3rd, 2008 07:27 AM
Problems sending email via smtp bcanter answers 6 March 20th, 2007 04:36 AM
How can I pass an image parameter in HTML? Is it possible??? John answers 23 July 24th, 2005 12:51 AM
HTML Forms in email ben3003 answers 4 July 17th, 2005 12:28 PM