php forms and html email

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Supershuffle
Forum Newbie
Posts: 6
Joined: Sat Aug 17, 2002 8:18 pm

php forms and html email

Post by Supershuffle »

I have enjoyed using php for handling forms and mailing on web sites, however I have been researching a solution for a different twist on the use of forms.

A client asked me i I could design an html email that would thank his customers and also perform a survey and upon submission send an email to him.

I have little experince with html emails, but I am inclined to think that sending variable data back would be problimatic without some for of datahandling by a webserver.

I have the html version of the form, however I was curious if anyone has any advice for me on wrapping it in an email?

Thanks in advance,

Jamie Keefer
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

I must have ADD or something because I lost you half way down. You are trying to just do a survey and email it to someone? Doesn't seem right since you would already be doing about the same thing with the other submission forums. Clarify for me, brother. ;)

-Aaron
User avatar
Zeceer
Forum Contributor
Posts: 136
Joined: Fri Aug 02, 2002 5:10 am
Location: Norway

Post by Zeceer »

You're going to send customers a mail that say thanx for you order something? And a mail to the boss with the information the customers filled out?

If so, I believe you can use the mail() function more time?

http://www.php.net/manual/en/function.mail.php
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

If you want them to do a survey give them a link to a web page with some id that identifies them in the query string.

Mac
Supershuffle
Forum Newbie
Posts: 6
Joined: Sat Aug 17, 2002 8:18 pm

More clarification

Post by Supershuffle »

It's hard for me to describe these things sometimes, sorry.

Let me try and put it this way.

I want to use Twigletmac's method, for one it's the only way I can think of to do it. That's the way it seems most surveys I get as email work. You receive a thank you email and a link to fill out a survey passing a value as a parameter in the URL.

The above is the only way I can think to send a variable from an email.

Recently I recieved an email that had two FORM textfield inputs. One field was labeled Area Code and the other was the prefix for a telephone number (the first three numbers). I saw this and was thinking, so they are sending user input back through this email. I entered some numbers and tried it. I got a listing of long distance carriers that supposedly were specific to my area. My first thought was, either I don't know how they are doing this or is this just a marketing ploy to make the email more interactive. I went back to my first thought and started wondering, is that possibe?

Is it possible to send FORM input back through an email?

If someone can help with that question, that would be a step in the right direction and would help me with this perplexing problem.

Thanks

EDIT:

I will be using the method Twigletmac suggested, but need to get to the bottom of this. :)
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

So are you saying you want to attach an .html file to the email, the user fills it in off-line and then sends it in an email back to you?
Supershuffle
Forum Newbie
Posts: 6
Joined: Sat Aug 17, 2002 8:18 pm

<cont.>

Post by Supershuffle »

The html would appear as the body of the email.

Edit: here is a company that offers services to manage an html email marketing campaign, for reference:

http://www.html-email-marketing.com/

Trying to figure out still the limitations of html email...thanks everyone for your help :)
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

You can do it, as long as the client has a recent, graphical, email client. Just send 'Content-Type: text/html' as one of the headers, and it should function exactly like any other webpage - forms and all.
Supershuffle
Forum Newbie
Posts: 6
Joined: Sat Aug 17, 2002 8:18 pm

Post by Supershuffle »

Woohoo! Thanks! That makes sense.

THe question is, how many people have html capable mail programs AND have it turned on.

I am gonna go try and mess around with it...thanks again...

Jamie Keefer
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

therein lies the rub. However, you can have the email program decide which email to show - the text or the html. Here's an example (a fine spam from cbs.com:)

Code: Select all

Received: from mailer05.sportsline.com (&#1111;64.30.226.129]) by mc1-f9.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.4905);
	 Tue, 13 Aug 2002 10:34:15 -0700
Received: (qmail 27845 invoked by uid 502); 13 Aug 2002 05:29:11 -0000
Date: 13 Aug 2002 05:29:11 -0000
Message-ID: <20020813052911.27842.qmail@mailer05.sportsline.com>
From: "CBS SportsLine.com" <6810877_615_1@mailer.sportsline.com>
Reply-to: "CBS SportsLine.com" <6810877_615_1@mailer.sportsline.com>
To: juegajedrez@hotmail.com
Subject: Free Tailgate Chair Offer for MLB Fans!
Content-Type: multipart/alternative; boundary=____________________________Next
Return-Path: mailer@mailer05.sportsline.com
X-OriginalArrivalTime: 13 Aug 2002 17:34:15.0908 (UTC) FILETIME=&#1111;A5621240:01C242EF]

--____________________________Next
Content-Type: text/plain

*****************************************************************
To view the COLOR version of this message, or if the links below
do NOT work properly, click here:
http://www.sportsline.com/u/newsletter/mailings/mail615_1.html?6810877
*****************************************************************

=================================================
A SPECIAL OFFER
brought to you by CBS SportsLine.com
================================================= 


Dear MLB Fan,

<!-- snip by Bill Mill - plain text email continues until: -->


--____________________________Next
Content-Type: text/html

<html>
<head>
<TITLE>MBNA Excllusive </TITLE>
<style>
<!-- Snipped by bill mill - HTML continues -->
</html>
<!--Deployed By yelvyp 8.12.2002 15:7:7 Log#:20020812150705_989_yelvyp-->


--____________________________Next--
Supershuffle
Forum Newbie
Posts: 6
Joined: Sat Aug 17, 2002 8:18 pm

Well now I can get a good nights sleep =)

Post by Supershuffle »

You have been a great help. I can not thank you enough.

I see you are from philly, my home town. GO EAGLES!! :D

Peace

Jamie Keefer
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

nope, just go to school in philly. I'm from connecticut. GO GIANTS! :twisted:
Supershuffle
Forum Newbie
Posts: 6
Joined: Sat Aug 17, 2002 8:18 pm

=)

Post by Supershuffle »

HAHAHA...right on!

It's gonna be a fun season...I hope =/
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

unfortunately, probably more fun for an eagles fan than a giants one this year, but who knows...
Post Reply