Jump to content
xisto Community
Sign in to follow this  
alexia

Build Contact Mail

Recommended Posts

Hi

I Write One Contact Mail and i want to share with u

at first

File index.htm : in this file build one form and post this form to [post.php]

and i find [# This script was written by George A. & Calin S. from Web4Future.com

] this php code on internet you can use this for send mail :

 

<?php$MailToAddress = "Here"; // your email address$redirectURL = "So Example Final.htm     "; // the URL of the thank you page.
# optional settings

$MailSubject = "Sample"; // the subject of the email
$MailToCC = "Back UP Mail"; // CC (carbon copy) also send the email to this address (leave empty if you don't use it)
# in the $MailToCC field you can have more then one e-mail address like "a@yoursite.com, b@yoursite.com, c@yoursite.com"# If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".# If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.# You can use this scirpt to submit your forms or to receive orders by email.# If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name" # you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple> # you have to do the same with checkboxes# This script was written by George A. & Calin S. from Web4Future.com# There are no copyrights in the sent emails.# SPAMASSASSIN RATING: 0.4# DO NOT EDIT BELOW THIS LINE ==================================================================# ver. 1.5$w4fMessage = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"www.w3.org/TR/html4/loose.dtd" http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><body>";if (count($_GET) >0) { reset($_GET); while(list($key, $val) = each($_GET)) {  $GLOBALS[$key] = $val;  if (is_array($val)) {   $w4fMessage .= "<b>$key:</b> ";   foreach ($val as $vala) {    $vala =stripslashes($vala);    $w4fMessage .= "$vala, ";   }   $w4fMessage .= "<br>";  }    else {   $val = stripslashes($val);   if (($key == "Submit") || ($key == "submit")) { }     else {  if ($val == "") { $w4fMessage .= "$key: - <br>"; }     else { $w4fMessage .= "<b>$key:</b> $val<br>"; }   }  } } // end while}//end ifelse { reset($_POST); while(list($key, $val) = each($_POST)) {  $GLOBALS[$key] = $val;  if (is_array($val)) {   $w4fMessage .= "<b>$key:</b> ";   foreach ($val as $vala) {    $vala =stripslashes($vala);    $w4fMessage .= "$vala, ";   }   $w4fMessage .= "<br>";  }    else {   $val = stripslashes($val);   if (($key == "Submit") || ($key == "submit")) { }     else {  if ($val == "") { $w4fMessage .= "$key: - <br>"; }     else { $w4fMessage .= "<b>$key:</b> $val<br>"; }   }  } } // end while }//end else$w4fMessage = "<font face=verdana size=2>".$w4fMessage."</font></body></html>";if (!mail($MailToAddress, $MailSubject, $w4fMessage, "From: $name <$email>\r\nReply-To: $name <$email>\r\nMessage-ID: <". md5(rand()."".time()) ."@". ereg_replace("/www/admin/; .">\r\nMIME-Version: 1.0\r\nX-Priority: 3\r\nX-Mailer: PHP/" . phpversion()."\r\nX-MimeOLE: Produced By Web4Future Easiest Form2Mail v1.5\r\nBCc: $MailToCC\r\nContent-Type: text/html; charset=ISO-8859-1\r\nContent-Transfer-Encoding: 8bit\r\n")) { echo "Please Write Information True";}else { header("Location: ".$redirectURL); }?>
Save this code in post.php file and its done :D

I know its easy but i think its best for php beginners :P

Share this post


Link to post
Share on other sites

Thank you for posting it :D Have you tried it firsthand yet? If not, I can go ahead and test it for you :P

Share this post


Link to post
Share on other sites

Do you have a screenshot of how it looks like when published? I really would love to see it :DCheers! :P

Share this post


Link to post
Share on other sites

Many people here (including me) had post some code about sending mails with php. :P This is a good one man, I liked it, good job. I just think the coments sucks the code would seem cleaner if you strip it out

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
Sign in to follow this  

×
×
  • 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.