/    Sign up×
Community /Pin to ProfileBookmark

Form email notification

I use a form that is part php and html I get a notification through email when the form is filled out I was woundering if the was a way to format the incoming e mail to look like the form it was submited from.

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@NightShift58Feb 01.2007 — You could send yourself an HTML mail as opposed to plain text.

You'll have to rebuild the layout and content of the form and displaying it.

Using ob_start(), ob_get_contents, and ob_end_clena(), you'll be able to capture and store the content of the screen to a variable which you can then send as the body of an HTML.

Make sure to set the MIME header accordingly.See: http://www.php.net/manual/en/function.mail.php
Copy linkTweet thisAlerts:
@big-dog1965authorFeb 01.2007 — Over my head can you explain a bit more

sorry but im very new to this
Copy linkTweet thisAlerts:
@NightShift58Feb 01.2007 — It means that you need a Page2 for your script and that it has to look just like Page1 - if that what you really want to do.

Page2's data will be echo'ed out but display content should be captured by PHP and stored to a variable. This is then sent by mail.
Copy linkTweet thisAlerts:
@hastxFeb 01.2007 — a simple way to think about it, and if you were going to write it all out, is that page 2 could:

grab your variables from the form

assemble them in the desired html output

hold all that in 1 big variable to be used as the message body

mail that big variable specified as an html message

[code=php]
$input1 = $_POST['input1'];
$input2 = $_POST['input2'];

$email_to = "[email protected]";
$subject = "subject matter";
$message = "<html><head><title></title></head><body>Input 1: $input1<br>Input 2: $input2<br></body></html>";

mail ($email_to,$subject,$message,"MIME-Version: 1.0n"."Content-type: text/html; charset=iso-8859-1");

[/code]
Copy linkTweet thisAlerts:
@NightShift58Feb 01.2007 — ... a way to format the incoming e mail to look like the form it was submited from.[/QUOTE]Herein lies the challenge...

[B]ob_start()[/B]
×

Success!

Help @big-dog1965 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...