/    Sign up×
Community /Pin to ProfileBookmark

Forms for e-mails

I’m not sure if this is possible even. I’m wanting to set up a page so that people can e-mail things (text only) to me with out it using the comps e-mail program.

I myself do not use out look express or programs like that so I can not use forms that use those to send the forms to the page owner and would like make a form that anyone can use.

So does anyone know if this is possible?

to post a comment
PHP

9 Comments(s)

Copy linkTweet thisAlerts:
@pyroMay 13.2003 — Yes, it is possible, assumbing that your server has a mail server. Here is the script that I use to do this.

[code=php]<?PHP

#######################################################
# This script is Copyright 2003, Infinity Web Design #
# Written by Ryan Brill - [email][email protected][/email] #
# All Rights Reserved - Do not remove this notice #
#######################################################

## The lines below need to be edited...

###################### Set up the following variables ######################
# #
$to = "[email protected]"; #set address to send form to
$subject = "Results from your Request Info form"; #set the subject line
$headers = "From: Form Mailer"; #set the from address
$forward = 1; # redirect? 1 : yes || 0 : no
$location = "thankyou.htm"; #set page to redirect to, if 1 is above
# #
##################### No need to edit below this line ######################

## set up the time ##

$date = date ("l, F jS, Y");
$time = date ("h:i A");

## mail the message ##

$msg = "Below is the result of your feedback form. It was submitted on $date at $time.nn";

foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "n";
}

mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo ("Thank you for submitting our form. We will get back to you as soon as possible.");
}

?>[/code]
Copy linkTweet thisAlerts:
@sniper18May 21.2003 — [code=php]
****USE THIS PART (BELOW) FOR YOUR FORM PAGE****

<!-- Begin Blue Wave Data Mail Form Header -->
<html>
<head>
<title>Contact Us</title>
</head>
<body vlink="#0000FF" alink="#0000FF">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="700">
<tr>
<td valign="top" align="left" width="700"><font size="5">C</font><font size="4">ONTACT</font><font size="5">
U</font><font size="4">S</font></td>
</tr>
<tr>
<td valign="top" align="left" width="700">F<font size="2">ILL</font> <font size="2">IN THE FORM BELOW AND CLICK</font> <font size="2"><b>&quot;SUBMIT&quot;</b></font></td>
</tr>
<tr>
<td valign="top" align="left" width="700" height="20"></td>
</tr>
</table>
</center>
</div>

<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="700">
<tr>
<td valign="top" align="left" width="50"></td>
<td valign="top" align="left" width="650">
<!-- END Blue Wave Data Mail Form HEADER -->
<FORM ACTION="feedback.php" METHOD="POST">
<input type="hidden" name="REMOTE_ADDR" value="<? echo $REMOTE_ADDR;?>">
<table border=0 width="400">
<tr>
<td><b><font face="Arial">Name:</font></b></td><td><input name="uname" type="text" rows=1 value="<?php echo $uname;?>" size="37"></td>
</tr>
<tr>
<td><b><font face="Arial">Email:</font></b></td><td><input type=text name="uemail" rows=1 value="<?php echo $uemail;?>" size="37"></td>
</tr>
<tr>
<td><font face="Arial">Telephone:</font></td><td><input type=text name="uphone" rows=1 value="<?php echo $uphone;?>" size="37"></td>
</tr>
<tr>
<td><font face="Arial">Subject:</font></td><td><select name="usubj" value="<?php echo $usubj;?>" size="1">
<OPTION>Suggestion
<OPTION>Comment
<OPTION>Question
</SELECT>
</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
<br>
<font face="Arial" size="4">Enter Your Questions or Comments Below:</font>
<table border=0>
<tr>
<td><textarea name="umsg" rows=7 cols=50 value="<?php echo $umsg;?>" size="800"></textarea></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="Send"></p>
</form>
<!-- BEGIN Blue Wave Data Mail Form FOOTER -->
</td>
</tr>
<tr>
<td valign="top" align="left" width="700" colspan="2" height="20"></td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="700">
<tr>
<td valign="top" align="center" width="700"><b><font color="#FF0000" face="Arial" size="2">MailForm V 1.0</font></b><font size="1" face="Arial"><br><a href="http://www.bluewavedata.com">Powered by Blue Wave Data</a></font></td>
<td valign="top" align="left" width="50"></td>
</tr>
</table>
</center>
</div>
</body>
</html>
<!-- END Blue Wave Data Mail Form FOOTER -->

****USE THIS PART (BELOW) TO PROCESS****
<?php
/*
Copyright 2002 Blue Wave Data, LLC ALL RIGHTS RESERVED
http://www.bluewavedata.com
PLEASE LEAVE THIS COPYRIGHT IN PLACE
*/

// ************* MODIFY THE NEXT THREE LINES *****************************
$title = "My Home Page"; // <--- PUT THE TITLE OF YOUR HOME PAGE BETWEEN THE "" MARKS
$home = "http://www.MyHomePage.com"; // <--- PUT YOUR URL BETWEEN THE "" MARKS
$mailto = "[email protected]"; // <--- PUT YOUR E-MAIL ADDRESS BETWEEN THE "" MARKS
// ********************* MODIFY NO MORE ********************************


// Thanks for the feedback etc.
PRINT "<html><head><title>Thank you</title></head><body><div align="left"><table border="0" cellpadding="2" cellspacing="0" width="100%"><tr><td width="100%" height="50"></td></tr><tr><td width="100%" valign="top" align="left"><p align="center"><font face="Arial" size="3">Your message has been sent.<BR>Thank you $uname, for your input.</font></p><p align="center"><font face="Arial" size="4"><a href="$home">Back To $title </a></font></p></td></tr><tr><td width="100%" height="20"></td></tr></table></div></body></html>";

//include("thanks.htm"); // or create a "thank you" page and uncomment this line (remember to comment "//" the section above)

// Scrape off the slashes before processing
$umsg = stripslashes($umsg);


// Here is where we grab and process the form and variables from mailform.php
// and e-mail the results to the value of "$mailto"


$mailfrom = "From: $uemail";
$subject= "$usubj";
$body = "* * * * * BEGIN FEEDBACK * * * * *nnSent from IP: $REMOTE_ADDRnName: $unamenEMail: $uemailnTelephone: $uphonenSubject: $usubjnMessage: $umsgnn* * * * * END FEEDBACK * * * * *";

mail ($mailto, $subject, $body, $mailfrom);

?>
[/code]
Copy linkTweet thisAlerts:
@eeyoreauthorMay 21.2003 — Ok I am new to php. Can someone walk me though setting this up? Do i need 2 web pages or just one or what?
Copy linkTweet thisAlerts:
@eeyoreauthorMay 21.2003 — Ok I figured out the feedback.php part but it does not seem to work. MAybe Angelfire does not support it.

If somoene would like to test it it is www.angelfire.com/rpg2/owensborothehunt/submit.html
Copy linkTweet thisAlerts:
@pyroMay 21.2003 — I don't know if angelfire supports PHP or not, but for PHP, you need to use a .php or .php4 for pages with PHP on them. Often times, free servers require the later.
Copy linkTweet thisAlerts:
@pyroMay 21.2003 — sniper18 -

That script will only work on servers with global variables enabled. You are much better off writing them so they work even if global variables are disabled. ie. $REMOTE_ADDR should be $_SERVER['REMOTE_ADDR'], and when echoing the form values, rather than doing it like this: $uname it should be $_POST['uname'], etc...
Copy linkTweet thisAlerts:
@JonathanJul 01.2003 — I need help! I dont know PHP, so would someone explain how to upload and setup the form? You can e-mail me at [email][email protected][/email] instead of the forum if you would like. My AIM name is creatormaster too...
Copy linkTweet thisAlerts:
@JonaJul 02.2003 — [i]Originally posted by Jonathan [/i]

[B]I need help! I dont know PHP, so would someone explain how to upload and setup the form?[/B][/QUOTE]


[font=arial][color=maroon]If you upload the code pyro provided, you should be able to get it working. If you have a specific question, post here or you can instant message me if you like (s/n is in my profile).[/color][/font]

[b][J]ona[/b]
Copy linkTweet thisAlerts:
@brendandonhueJul 02.2003 — Angelfire doesn't support PHP, you won't get these scripts to work eeyore.
×

Success!

Help @eeyore 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,
)...