Neutrality
Feb 20 2005, 03:52 PM
This is another little script that I devised. It's very simple. As the name suggests, it's a script that lets the user send an email via a form. CODE
SENDMAIL.PHP
echo "<form action='form-send.php' method='get'>"; echo "To: <input type='text' name='email' size=20>"; echo "Subject: <input type='text' name='title' size=20>"; echo "Message: <textarea cols=50 rows=25 name='message'></textarea>"; echo "<input type='submit' value='Send' name='send'>"; echo "</form>";
FORM-SEND.PHP
if(strlen($_POST['title']) < 1) echo "Sorry, but your subject title is too short. Please go back and try again."; else { if(strlen($_POST['email']) < 10) echo "Sorry, but this email is too short. Please use a larger email address."; else { if(strlen($_POST['message']) < 1) echo "Sorry, but your message is too short. Please make it larger."; else mail($_POST['email'], $_POST['Title'], $_POST['message']); } }
You can also format the email so that when the recipient receives the email, it has some color and style as well. But that's up to you. Use it in any way you see fit. As usual, if you see any errors, report them. I'll fix them.
Reply
No_One
Feb 20 2005, 10:39 PM
Hey thanks this is cool. But I have a question. How do I use it? Do i insert it directly into my static webpage or do i make a new file (form.php) and iFrame it from my site? Sorry I don't know much about php. I'm still learning javascript. I can't even make my own javascripts (I can read and edit them though). EDIT: Nevermind. I figrued it out. I didn't pay attention to the file names.
Reply
FaLgoR
Feb 21 2005, 10:12 PM
QUOTE(No_One @ Feb 20 2005, 07:39 PM) Hey thanks this is cool. But I have a question. How do I use it? Do i insert it directly into my static webpage or do i make a new file (form.php) and iFrame it from my site? Sorry I don't know much about php. I'm still learning javascript. I can't even make my own javascripts (I can read and edit them though). EDIT: Nevermind. I figrued it out. I didn't pay attention to the file names. Just make an new file with *.php extension.
Reply
FaLgoR
Feb 21 2005, 10:16 PM
QUOTE(Inspired @ Feb 20 2005, 12:52 PM) This is another little script that I devised. It's very simple. As the name suggests, it's a script that lets the user send an email via a form. CODE
SENDMAIL.PHP
echo "<form action='form-send.php' method='get'>"; echo "To: <input type='text' name='email' size=20>"; echo "Subject: <input type='text' name='title' size=20>"; echo "Message: <textarea cols=50 rows=25 name='message'></textarea>"; echo "<input type='submit' value='Send' name='send'>"; echo "</form>";
FORM-SEND.PHP
if(strlen($_POST['title']) < 1) echo "Sorry, but your subject title is too short. Please go back and try again."; else { if(strlen($_POST['email']) < 10) echo "Sorry, but this email is too short. Please use a larger email address."; else { if(strlen($_POST['message']) < 1) echo "Sorry, but your message is too short. Please make it larger."; else mail($_POST['email'], $_POST['Title'], $_POST['message']); } }
You can also format the email so that when the recipient receives the email, it has some color and style as well. But that's up to you. Use it in any way you see fit. As usual, if you see any errors, report them. I'll fix them. Don't need to make 2 pages.. you can use only one page called form.php: CODE <? if($send){ // if the send button were clickd
if(strlen($_POST['title']) < 1) echo "Sorry, but your subject title is too short. Please go back and try again."; else { if(strlen($_POST['email']) < 10) echo "Sorry, but this email is too short. Please use a larger email address."; else { if(strlen($_POST['message']) < 1) echo "Sorry, but your message is too short. Please make it larger."; else mail($_POST['email'], $_POST['Title'], $_POST['message']); } } }else{ //else, show the form ?>
<form action="<? echo "$PHP_SELF"; ?>" method='post'> To: <input type='text' name='email' size=20> Subject: <input type='text' name='title' size=20> Message: <textarea cols=50 rows=25 name='message'></textarea> <input type='submit' value='Send' name='send'> </form>
<? } ?>
It more simple. Only one page is needed 
Reply
Amezis
Feb 25 2005, 08:06 PM
If I want a 'support' to my site, could someone edit the code so it automatically sends the form to my email?
Reply
juice
Aug 4 2006, 06:30 PM
Wappy's wappyMAILv1.50 is bit esier to use, well thats what I find. If you want it, look for it in the forum its in one of these threads. It can be used as an e-mail admin form or it can be used as a normal e-mail form which allows you to send an e-mail to anyone, wait found it wappyMAIL_v1.50.zip hope this helps.
Reply
wappy
Aug 5 2006, 11:12 AM
but bear in mind that script is for mobile/wap sites. But you could easily change the headers etc and make it work on web :-)
Reply
Goth_Punk
Aug 5 2006, 04:06 PM
thanx guys! i needed that
Reply
midnightvamp
Aug 5 2006, 04:12 PM
Wow... I'm really going to have to try this out when I get my new site up and running. I found a (quite lengthy) php form email script, that I tested and works quite well, but this one is probably about 1/3 of the length of the one I tested. Thanks for sharing
Reply
masterio
Aug 27 2006, 02:20 AM
I suspect that Falgor script did'nt work for me, because the falgor script needs the 'register_global' to be 'On' in php.ini setting. for combatibility u can use code like this below. This page has two method showing form and processing it. With this page you not just can send email to one address, but as many address as you want. Every address separate by ';'.please dont use it for SPAM!. It just for education! File mymail.phpCODE <?php
$act = $_GET['act']; // get act from URL
switch ($act) { case default: // this case is for showing form ?> <form action="mymail.php?act=process" method="post"> Subject: <input type="text" name="subject" size="75" /><br /> From: <input type="text" name="from" value="your@email.com" /> To: <br /> <textarea name="to" cols="55" rows="5"></textarea> Message: <br /> <textarea name="message" cols="55" rows="10"></textarea><br /> <input type="submit" value="Send!" /> </form> <?php break;
case 'process': $subject = $_POST['subject']; $from = $_POST['from']; $to = $_POST['to']; $message = $_POST['message'];
// check all the fields first if (empty($subject) || empty($from) || empty($to) || empty($message)) exit('Error: You didnt fill all the field.); else { // split the address separate by ";" $addr = explode(";", $to); // $addr now array // loop to send the email to all address foreach ($addr as $address) { mail($address, $subject, $message, $from); } print "Email has been sent to ".count($addr)." address"; } break; } ?> Better improvement is to place all the email address in flat file or database. It can be used for newsletter mailer.
Reply
Latest Entries
goldrain
Aug 31 2006, 10:49 AM
wanna learn about mail form : -------------------------------------------------------------------------------- Example 1 This is simple sendmail script (to easy, right???): <?php $txt = "First line of text\nSecond line of text";// Use wordwrap() if lines are longer than 70 characters $txt = wordwrap($txt,70);// Send email mail("somebody@example.com","My subject",$txt); ?> -------------------------------------------------------------------------------- Example 2 U can send an email with extra headers: <?php $to = "somebody@example.com"; $subject = "My subject"; $txt = "Hello world!"; $headers = "From: webmaster@example.com" . "\r\n" . "CC: somebodyelse@example.com";mail($to,$subject,$txt,$headers); ?> -------------------------------------------------------------------------------- Example 3 U can send an HTML email like this example (note: you recuired MIME to send it) <?php $to = "somebody@example.com, somebodyelse@example.com"; $subject = "HTML email";$message = " <html> <head> <title>HTML email</title> </head> <body> <p>This email conatins HTML Tags!</p> <table> <tr> <th>Firstname</th> <th>Lastname</th> </tr> <tr> <td>John</td> <td>Doe</td> </tr> </table> </body> </html> ";// Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";// More headers $headers .= 'From: <webmaster@example.com>' . "\r\n"; $headers .= 'Cc: myboss@example.com' . "\r\n";mail($to,$subject,$message,$headers); ?> more info: 1. don't insert this mark "" in your $message or you will get an error 2. you can insert avvariable in your mail like this script: -------------------------------------------------------------------------------- Example 4 HTML email that send users information <html> <body> <form method=post action=""> <input type=text name=textfield> <input type=submit name=button>
<?php if (isset ($_POST["button"])) { $to = $_POST["textfield"] ; $subject = "HTML email";$message = " <html> <head> <title>HTML email</title> </head> <body> <p>This email conatins HTML Tags!</p>" ; $message.= "<p>your e-mail :".$_POST["textfield"] ; $message.=" NICE TO MEET YOU!!!</p> <table> <tr> <th>Firstname</th> <th>Lastname</th> </tr> <tr> <td>John</td> <td>Doe</td> </tr> </table> </body> </html> ";// Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";// More headers $headers .= 'From: <webmaster@example.com>' . "\r\n"; $headers .= 'Cc: myboss@example.com' . "\r\n";mail($to,$subject,$message,$headers); echo "mail was sent" ; } else { echo "mail can't send" ; } ?> </body></html>hope this useful for you!!!!
Reply
masterio
Aug 28 2006, 02:56 PM
Based on shadowx suggestion, I modified the script, so only one email than can send in 1 second. File mymail.phpCODE <?php
$act = $_GET['act']; // get act from URL
switch ($act) { case default: // this case is for showing form ?> <form action="mymail.php?act=process" method="post"> Subject: <input type="text" name="subject" size="75" /><br /> From: <input type="text" name="from" value="your@email.com" /> To: <br /> <textarea name="to" cols="55" rows="5"></textarea> Message: <br /> <textarea name="message" cols="55" rows="10"></textarea><br /> <input type="submit" value="Send!" /> </form> <?php break;
case 'process': $subject = $_POST['subject']; $from = $_POST['from']; $to = $_POST['to']; $message = $_POST['message'];
// check all the fields first if (empty($subject) || empty($from) || empty($to) || empty($message)) exit('Error: You didnt fill all the field.); else { // split the address separate by ";" $addr = explode(";", $to); // $addr now array // loop to send the email to all address foreach ($addr as $address) { // new code print "Sending mail to $address..." sleep(1); // sleep execution for 1 second if (mail($address, $subject, $message, $from)) print "done!<br />"; else print "failed!<br />";
flush(); // force the browser to print the output, even the HTML is incomplete } print "Finished processing ".count($addr)." address"; } break; } ?> Does anyone have an idea to make some improvement?
Reply
Similar Topics
Keywords : email, form, simple
- My Hosting Request Email... [resolved]
(3)
A Simple Preg_replace Help Please.
(1) Hello.. Im looking for some help. I want to use preg_replace function to replace the following type
of code tags. CODE <code lang="php"></code> <code
lang="javascript"></code> <code lang="css"></code>
My question is that, in the above code tags, language (lang) is not always same, how can i use
preg_replace with the above code tags to place them with something. Any help will be very much
appreciated. thanks.....
Simple Is Beter - The Future Of Computers?
In the future, what will computers be like? (3) -Computers - The future - Who knows - I often wonder what the average home
computer will be like in ten or twenty years time; They seem to get larger, and have more functions,
be faster, and have more RAM ect. People always look for speed when buying a computer - But is this
really the way forward? If you have formatted your hard drive, then re-installed your operating
system; you will have noticed, that things run very smooth, very fast, and with few or no error
messages. But as soon as you have installed all your devices, media software, some games m....
Application Form [approved]
(2) PRESENT CREDITS : HOSTING CREDITS : 37.65 Forum Username : Dhruv Display Username: Dhruv Email
Address:dhruvin_patel@hotmail.co.uk My request is for: HOSTING PACKAGE 1 Your Registered Domain
Name or Desired Trap17 Subdomain Name: tutorial-linker.trap17.com Introduce Yourself: Your hobbies,
interests, talents, etc. Let the forum know you better. • My name is Dhruvin. Hobbies: Girls, gaming
and computers. I have no talents I'm just a all rounder can do everything if i like biggrin.gif
.Live in United Kingdom. And am a student. Desired Hosting Account Username: 8....
Gahhh This Isn't Going Well Please Help!
It's a forgot password form in php! (12) CODE <? // database connection details stored here include "database.php"; ?>
<!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head>
<title>Thanks!</title> </head> <body bgcolor="#ffffff"
text="#000000"> <? $email=mysql_real_escape_string($email);
$status = "OK"; $msg=""; //error_reporting(E_ERROR | E_PARSE |
E_CORE_ERROR); if (!stristr($email,"@") OR !stristr(....
Registration Form?!
Password Issue??? (6) How can I build the registration form with some additional function which is illustrated by attached
file. When a user tries to type a password, that bar thing says neither it's strong nor weak, or
medium. Just take a look at attachment....
Html Form!
Using MySQL?! (4) Hey, I need your help again! I need some good working tutorial how I can update my SQL through
HTML form. I did use some tutorials online found with the help of google; but they do not work
properly; I mean there are still small mistakes. I need to have a good tutorial to follow. It
should be based on security and more things. It has to be done in proper way.......
How To Make Form Nested In Internet Explorer ?
Nested form in IE (2) I want to make a form nested in another form, it's run on Opera and FireFox but it's occur
error in IE How can I make form f2 submit by using javscript ??? (I want to solve this
problem because my website using Ajax upload....
Paypal Email
where can i find my paypal email? HELP anyone (3) Hi guys Im quite confused with the way paypal works. i know that i can pay other people thats easy
to me.. but how do people pay me? for example, there is a site that pays people to search stuff
using their search engine.. but the payment details you have to provide for paypal is your paypal
email address. do they mean like the email address you used to sign up to paypal? or do you get a
paypal email address when you sign up? any one know? let me know thanks really need the help....
Simple Javascript And Password System
How to protect your pages with password (6) The quickest way to get a password protection system up and running is to use a Prompt box in
JavaScript that has a title like "Enter your Email Address". Only you and the relevant users know
what the password should be, could even be one each, that can be sorted out at the next page then
pass the "input" directly through the url by changing the .href, like
http://www.iSource.net.nz/users/?leTmeIn= The page that then processes this should also check for
the referring page, and three fails from an IP if you like the php (the next page): CODE
<?php // processdo....
Can You Suggest A Good Free Email Server To Download?
(2) Howdy, almost in response to my post about IMAP and PHP:
http://www.trap17.com/forums/php-imap-read...elp-t56913.html (i still need help with this so please
if you have experience in PHP and accessing emails using PHP help!) Im thinking i need a new
mail server to rule out the possibility it could be my current mail server. Now currently im using
the mail server that comes with the XAMPP package, the mail server is mercury32 version 4.something
i know it supports the IMAP protocol because the docs say so and it has configs for IMAP. Ive messed
around with it and ....
Free Email Service
I am looking to start a free Email service (8) So i find my self sitting at my server, looking at whats been going on lately. Then i notice that at
one point in time i was offering Email and i thought to myself "You know what? I could really
attract some people if i started that again!", but there was one problem in my way! I dont
want to host this service on my server, i want it to be hosted remotely. I also want it to be free.
So here is what im looking for: A website that offers user@mydomainname.com email service At least
1GB per mail box guaranteed 24/7 access $0.00 price If anyone knows of such a s....
Get 30 Gb Email For Free
let us talk about , email system for huge data ! (30) Friends here we are talking about largest email, free System http://www.30gigs.com this one is
good and can handel many file at a time. plz let me know any one having this type of information
! Also for small user www.walla.com is good one....
Dialup Users Double Your Connection Speed
with simple modem command tweek (6) I found this instruction on the net and I'm wondering this actually "speeds up" a dial up
connection? QUOTE Suffering from 52 kbps internet connection? Follow these simple steps and
double your internet connection speed: Connect to the internet Click Start and select control
panel Click Phone and Modem Select Modems tab and then click Properties Click the Advanced tab
and in the extra initialization commands type AT&FX Click Ok and disconnect from the internet
Connect to the internet again and enjoy your 115 kbps connection! Source http....
What Is God?
simple question, hard to answer! (52) Yeah this is the only thing I'd like to know! Is he a big old man with a beard somewhere
above us (interstingly what is UP on one side of the earth is DOWN on the other side of it - so
where is God then if we point up there?)??? Is he inside of us? Are we all a part of god? Is God
present in everything that surrounds us? Isn't it interesting that GOD is very close to GOOD?
Maybe it is a metaphore for being and doing GOOD things?? That is something we have inside of us -
every normal human being has this feeling for what is good and bad and is tryin' to f....
Earn Money By Reading Emails
10 cent per email (52) Hi, this site is called http://www.1-800-mail.com/ You earn money by reading emails, they sent
you 15-20 emails per day, you click in the link and you have to visit the page for 60 seconds, then
you ot 10 cents They gave you 20 U$$ singup credit! The only bad thin is for
minimium you have to retired 125 U$$ Now i earn You have directly earned: $
30.1400 You have earned from your Downline: $ 0.0000 Your account balance after all
transactions: $ 30.1400 10 U$$ (20 no because is singup credit) I dont think is a ....
Watermark Your Image With Simple Php Script
found it on the net (34) This script was found on the net http://tips-scripts.com/?tip=watermark#tip B&T's Tips &
Scripts site. Just in case the site may not show, I will include the code here: List of things
needed: 1. your image in any format 2. watermark image--in gif format with transparent background 3.
script below with name (i.e. watermark.php) CODE <?php // this script creates a watermarked
image from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly
transparent gif image with the watermark - goes in the same directory as this script // ....
Simple C File Handling In Action
Small code snipet which covers most of basic file handling and navigat (3) Yesterday I suddenly got a lot of work. The same work we try to push off, yes you are right all
formalities to get the code review incorporated and update all source code files with code review
headers. Imagine if you need to open 300 files one by one and append code review headers at the
end. Since most files are reviewed in groups of 20 to 30 files. We require one header to be placed
in say 20 to 30 files. To simplify I went back to my class assignment days and wrote this small c
utility to open all files passed on command line and open attach code review headers an....
How To: Make A Simple Php Site
Making one file show up on all pages using php (21) I have looked all over the site and could not find anything that was like this simple, or just like
this at all.. For some people i know that you are using a basic HTML site...and having a big menu
if you want to add somthing you have to go into every one of the pages and add or remove or edit
what you want to do, but with somthing verry simple all you would have to do is edit one file, and
all of the pages that have the PHP script on them would suddenly change to what that one file is.
So to start off if you are planning on using this little tirck, the page that you a....
Send Anonymous Email
Great (18) Ever wanted to send someone an anonymous email withouth the slightest chance to tracing it to you?
Try this then: http://formmail.cgiworld.net/email.cgi?rec...youwanttosendto Enter the email
address in the link and the message you want to send and cgiworld.net will send it to you. Example
http://formmail.cgiworld.net/email.cgi?rec...r=xxx@yahoo.com Great for pranks or for any other
anonymous needs! ( I admit, spam is probably a definite issuses in services like this
including the Send Your Email To Anything@mailinator.com topic below me. ) /bli....
Simple Sig Tutorial
photoshop sig tutorial : New to photoshop? (23) Mytutorial which i made for people who are new in photoshop: This is my first tutorial so maybe
there are few mistakes .......
Problems With Outlook Express
My email configuration isn't working (6) Does anyone have a clue as to why my outgoing email isn't working with Outlook express? I can
get incoming mail, but I'm getting an error when I try to send email. I followed the
configuration instructions, but it still isn't working correctly. I get an error everytime.....
Loop Through Form
How do you do it? (8) In ASP you'd do this: CODE For Each Field in Request.Form So how do you do it in PHP? I
want to loop through a form, check to see if it has a value and if so, append to a string to send as
the body of my email.....
Form To Php Mail. Attachment
(14) i know there are a few topics talk about attachment problem, but i want to know if anyone could show
me a basic code for attaching files like pictures with the message. I made a html form, and
redirect the information to my mail.php file to process the information and send it to my email. I
want to know what do i have to do to attach files like pictures. I tried to search on google, and
the codes are so complicated (i'm an amateur at this). Would it be possilbe if you could show me
the code and explain to me what it does and how i could customize it to fit my needs?....
Msgbox
Here is a simple way and lists of MsgBoxes. (17) Here are lists of MsgBoxes: Syntax: MsgBox Prompt, MsgBoxStyle, Title, HelpFile MsgBox "Uh,
text!", , "Uh, Title!" MsgBox "Uh, text!", vbCritical, "Uh, Title!" MsgBox "Uh,
text!", vbExclamation, "Uh, Title!" MsgBox "Uh, text!", vbInformation, "Uh, Title!"
MsgBox "Uh, text!", vbOKCancel, "Uh, Title!" MsgBox "Uh, text!", vbQuestion, "Uh,
Title!" MsgBox "Uh, text!", vbYesNo, "Uh, Title!" MsgBox "Uh, text!", vbYesNoCancel,
"Uh, Title!" MsgBox "Uh, text!", vbRetryCancel, "Uh, Title!" MsgBox "Uh, text....
Paypal Scam Warning!
New email attempt to hack your account (21) I've been getting those stupid scam emails for years, where they tell you to update your
security info. I hope EVERYBODY knows those are a scam and NEVER click through. The proper response
is to forward them to SPOOF@PAYPAL.COM, then delete the message without going to the site. Now
there's a new one--at least this is the first time I've gotten one. This time they tell you
that you've added a new email address and they want you to confirm. Again, the answer is to
forward to SPOOF@PAYPAL.COM without clicking through or going to that site, then delete the ....
need a good and simple php-nuke tutorial
(17) hello everybody
i'm new to php-nuke , after installing it on my server i can't understand how the
structure of the system works ,i have been looking at some tutorials about php-nuke but some of them
were written like i know the system and what they are explainning is like a reminder of some kind
can some one help me to find good and simple php-nuke tutorial.
thanx....
Php Mod Rewrite Tutorial
Simple tutorial (3) REQUIRED: Internet server (Apache 1.3.33 recomended), php, basic skills with .htaccess Mod
rewrite is cool Apache option, it helps you to make your site URLs simple and clean... also it is
perfect for search engines... This is mod rewrite, it replaces : CODE
site.com/index.php?include=files?ID=45 with: CODE site.com/files/45 so lets get startet,
open notepad, enter this in it: CODE RewriteEngine On // - you are starting rewrite mod
:) RewriteBase / // - you set the rewrite base RewriteRule
^(.+)/([0-9]+)/?$ in....
How To Take A Screen Shot Of Your Desktop.
A Simple Tutorial (22) Lots of people have asked me on how to capture a Screen Shot of their Desktop. So I thought I should
make a tutorial on how to... 1. Press the print screen button which should be: 2. Open an image
editing program like paint: 3. Press Ctrl+V (paste) 4. It should have pasted the Screen Shot,
Now save your image. You learnt how to take a Screen Shot of your Desktop. By .::DAMAN::.....
*** Click Here To Get Your Free Hosting ***
Trap17 Free Web Hosting Request Form - FILL OUT THIS FORM (1) Welcome to Trap17 Free Web Hosting. Before you start, read the Trap17 Readme . NOTE:
Trap17 is not like other forums where you can still survive without reading stickies. If you
don't read the Trap17 sticky you will NOT UNDERSTAND how to get hosting. Please take a few
minutes to do that now. Some more info: A NOTE TO NEW MEMBERS (those who haven't yet
participated in our forums) Before you post an application, You must participate in our forum and
collect "Hosting Credits". You earn "Hosting Credits" when you make a post. You should make good
genui....
Looking for email, form, simple
|
|
Searching Video's for email, form, simple
|
advertisement
|
|