A step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.
A C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.
This tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.
Creating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.
Simple way of making a mail scriptAn example for a very simple way to make a mail script that supports HTML tags in PHP. |
On Tuesday, October 19th 2004 at 01:42 AM By Joël Anthöni (View Profile) ![]() ![]() ![]() ![]() (Rated 4.8 with 104 votes) |
||
|
Lets first create our HTML page to test with this script, i've commented out every line so its easier for you to copy and paste it into your text-editor and edit it
<?
I hope you enjoyed this tutorial/example |
|||
Digg It!
Del.icio.us
Reddit
StumbleIt
Newsvine
Furl
BlinkList
|
|||
|
|||
Current Comments<i>Comment deleted due to its commercial nature.</i>
I can't get this script to work correctly...
I get a big jumble once i hit submit:
click here to go back"; $name = intval($_GET['name']); $message = intval($_GET['message']); $email = intval($_GET['email']); $subject = intval($_GET['subject']); /* Let's check if all fields are filled in! This is a very easy one, but it works perfect.. Why doing it the hard way while it can be done easely huh ;) */ if($name == "" || $message == "" || $email == ""){ /* Lets echo that error! ;) If you want you can also use a JavaScript Application to show a warning-popup. */ echo $error; } /* if after all everything is filled in correct, lets start sending the mail.. Edit the variable's below to fit your needs. */ else{ $yourwebsite = "http://webrsg.com"; // Your website adress. $recipientname = "HR"; // Whats your name ?! $subject = "Job Inquiry from WebRSG.com"; // The subject of the mail thats being sended. $recipient = "jobs@webrsg.com"; // the recipient (in most case's..this is your e-mail!). /* The headers for the e-mail, no need to change it unless you know what you're doing. */ $header = "From: $name <$email>\r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-Type: text/html; charset=iso-8859-1\r\n"; $header .= "X-Priority: 3\r\n"; $header .= "X-MSMail-Priority: Normal\r\n"; $header .= "X-Mailer: PHP / ".phpversion()."\r\n"; /* You can change the text/html below to whatever you wish to have. you can use HTML! */ $content= " Dear $recipientname, $name has sent you an e-mail from $yourwebsite regarding $subject.
Message:
$message
User IP: $ip
--------------------------------------------------------------------------------
Contact $name at $email."; /* Lets send the e-mail by using the mail() function. No need to change below...this can be edited above! */ mail($recipient, $content, $header); /* Message the user will see if the e-mail is succesfully sended, You can also send an e-mail to the sender, for this place the following line's under the above mail() function: $thanks_mail = " Dear $nickname, thank you for sending us an e-mail.
We will try to contact you back withing 24hrs on $email.
Make sure to not forget to bookmark us! $website."; mail($email, $thanks_mail, $header); */ echo "Thanks you, $name. Your e-mail has been sent succesfull. We will contact you back shortly."; } ?>
mememememememememememememememe
I've used the 'Simple way of making a mail script', I've uploaded the mail.php and my htm file with the form in, when I fill out the form and press send it keeps coming up with - There are some fields not filled in, click here to go back.
All three fields were filled in so I'm a little baffled by this.
Any suggestions
when using this code is it necessary to create a database to retrieve the information that the user put in?
Related Tutorials
Related Source Code
PHP Job Search