Form Submission/Mail To Script

Links for php scripts

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 8
Joined: Thu Nov 25, 2004 11:52 am

Form Submission/Mail To Script

Postby xiaoaiz1865 » Thu Nov 25, 2004 12:17 pm

Here it is.

Code: Select all

<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<form action="mailit.php" method="post" name="frmEmail" id="frmEmail">
  <input name="name" type="text" id="name">
  <input name="email" type="text" id="email">
  <textarea name="message" id="message"></textarea>
  <input type="submit" name="Submit" value="Submit">


Code: Select all

sMessage = "Message from: " + $_GET['name'] +"<BR>";
sMessage .= "Email: <a href='mailto:" + $_GET['email'] + "'>" + $_GET['email'] + "</a>";
sMessage .= "Message was:" + $_GET['message'];
mail "", "Contact Mail...", sMessage;

Change to your email address.

New php-forum User
New php-forum User
Posts: 180
Joined: Fri Mar 07, 2003 4:59 pm

Postby Alex » Mon Nov 29, 2004 9:26 am

I dont want to upset you in any way, but there is room for improvement. For example, you could check the validity of the email adress (in part) via reg exp and allow for attatchments (i beleive i wrote a class for that a while back, but there is lots of documentation and examples out there). Its a good idea to put a from field in there too...

Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests