Hi,
What is your favorite FREE PHP form Mail scripts? I am looking for a very customizable one.
Thanks
Your recommended PHP Formmail scripts
Moderator: General Moderators
-
bestempire
- Forum Newbie
- Posts: 3
- Joined: Thu Sep 18, 2003 1:14 pm
-
Cruzado_Mainfrm
- Forum Contributor
- Posts: 346
- Joined: Sun Jun 15, 2003 11:22 pm
- Location: Miami, FL
- Toneboy
- Forum Contributor
- Posts: 102
- Joined: Wed Jul 31, 2002 5:59 am
- Location: Law, Scotland.
- Contact:
I sense a newbie, and I tell you something, when I was a newbie, all the mail paragraphs in the PHP manual seemed to be pretty confusing.
What I'll do here is post what I normally use (still pretty basic), so you can get an idea about what to do (if you need it) and go from there. (BTW I have 2 $mailTo lines so a copy of each e-mail goes to both my home and web e-mail addresses.
What I'll do here is post what I normally use (still pretty basic), so you can get an idea about what to do (if you need it) and go from there. (BTW I have 2 $mailTo lines so a copy of each e-mail goes to both my home and web e-mail addresses.
Code: Select all
<?
// other content
$host = gethostbyaddr($REMOTE_ADDR);
if(!empty($message)){ // only send if the form has been filled out.
$mailTo = "Staff <feedback@e-mail.com>" . ", " ; //note the comma
$mailTo .= "Staff <feedback@e-mail.org";
$mailHeaders="From : "$realname" \<$email\>";
$mailSubject="site feedback";
$mailBody="Sent by $realname ($email)\nFrom $REMOTE_ADDR ($host)\n";
$mailBody.="Message:\n\n$message\n\n\nE-mail generated by http://www.yoursite.com";
mail($mailTo, $mailSubject, $mailBody, $mailHeaders);
echo "<b>Your email has been sent</b><p>";
}
print ("<form method=post>
Your name: <input type=text name=realname SIZE=40 MAXLENGTH=80><br>
Your email: <input type=text name=email SIZE=40 MAXLENGTH=80><br>
Subject: <input type=text name=subject SIZE=40 MAXLENGTH=80><br>
Your message:<br> <textarea name=message ROWS=5 COLS=40></TEXTAREA><br>
<input type=hidden name=sent value=1>
<input type=submit value=Send>
<input type=reset value=Clear>
</form>");
//other content
?>