Jump to content
xisto Community
snlildude87

Email Script/form With Php how to make a simple email script using php

Recommended Posts

The forum is loaded with these kind of script.... really loaded o.O

150653[/snapback]

Really?? I thought this mail tutorial thing is the first on Xisto. :P Can you give me 2 or 3 mail scripts that people have submitted in the past?

Share this post


Link to post
Share on other sites

I'd just like to add that mail headers should use \r\n line breaks, as per RFC 2822 section 2.1.

 

Also if you want something more 'complicated', use PHPMailer.

131564[/snapback]

So instead of

$headers = "MIME-Version: 1.0\n";$headers .= "Content-type: text/html; charset=iso-8859-1\n";

We should use

$headers = "MIME-Version: 1.0\r\n";$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";  

???

 

And what php mailer?

 

Notice from jlhaslip:
edit to include code tags

Edited by jlhaslip (see edit history)

Share this post


Link to post
Share on other sites

Wow man great thx for giving me this script i was really searching for this script from so many days. I had searched google, yahoo etc... but none of them worked. But i found one in google but that script used to send the mail from contact form after few hours or so...... Those scripts lack, but urs is good script man. Please kepp posting the scripts for many programs and also i want the script for posting a google adsense banner on my forums pages, if you know the script please kindly let me know about this to me as soon as possible.

Share this post


Link to post
Share on other sites

Emm this Email script is very useful if you are making website for lots of people that will visit it.. like you can make with it and Feedback form that will send you the visitor ideas.. I ussaly put it too on my websites so it have easyer way to visitors contact me..Nice tutorial hope to see some more things from you.. :(

Share this post


Link to post
Share on other sites

hey, just a little member to member tip Kreative Net.: Deep Innovations, you shouldn't be typing Sunny Kumar GuptaFounder,
The KreativeNetworks at the end of all of your posts we have a signature option for this Click Here for a tutorial on how to set-up the signature


And no you cannot use this script on a non PHP supporting site, because in order for this to work the page extention would need to be .php, therefor the host must support php and have mail enabled for it to work!

as for editing it, you would need to do/learn that yourself because it is a bit of a big process..lol but what do you mean by edit...maybe i can help you with it!
Edited by Albus Dumbledore (see edit history)

Share this post


Link to post
Share on other sites

I used to use a script similar to this for my contact page. However, lately I have been getting spam email sent via my contact page. The reason for this is I did not have adequate validation on the fields for the form. While I had the form checking the various fields exist, I did not check for a valid email address. This script will suffer from the same problem, to resolve it I suggest inserting the following code as shown.

$from = $_POST["from"];  //gets the name of the person  $email = $_POST["email"];  //gets their email address//start email address check codefunction check_email($email) { 	if(ereg("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $email)) {		return 1;	}	else{		return 0;	} }$email_ok = check_email($email);if ($email_ok == 0) {echo("The email address you entered is invalid");exit;}//end email address check code  $content = "This message is from $from whose email address is $email.\r\n-----------\r\n ";
This checks the email address is in the form of "someone@domain.com", if it is not the script will show the message, "The email address you entered is invalid" and exit the script. While this will not stop the message being sent when a fake email address is entered, I have found some of these spammers tend to not use an address. Hopefully this will save you from some of the spam mail I have suffered from.
Edited by Avalon (see edit history)

Share this post


Link to post
Share on other sites

Oh my GOD ! That is a page full of very help-full information , infact that particular forum would help much to the new beginners , like me , in the field od Web Designing . Thank you buddies... It would be helpfull for me when working on my site:D

Edited by Bad-Boy (see edit history)

Share this post


Link to post
Share on other sites

Hey snlildude87it is a nice script for mail it gonna ba very useful for me thanks..........Hey

Notice from jlhaslip:
It is not neccesary to quote the previous posting unless it is important to your comments.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.