View previous topic :: View next topic |
Author |
Message |
Womanizer Grandmaster Cheater
Reputation: 2
Joined: 30 May 2009 Posts: 958
|
Posted: Fri Jul 16, 2010 2:27 pm Post subject: Need mail script (html) |
|
|
I am looking for a script (html) that gots two text boxes one for name and one for text. It should be looked like for posting news into my website. (but into my mail) It should be a working one because i didn't find anything on google and i am still trying to search and find something.
|
|
Back to top |
|
 |
justa_dude Grandmaster Cheater
Reputation: 23
Joined: 29 Jun 2010 Posts: 891
|
Posted: Fri Jul 16, 2010 8:00 pm Post subject: |
|
|
If you don't have cgi/ssi/whatever access and you just need basic HTML, you probably have to settle for mailto://
This site: http://lmgtfy.com/?q=html+form+email+mailto has roughly 180,000 examples that you can study.
Cheers,
adude
|
|
Back to top |
|
 |
BOU Expert Cheater
Reputation: 0
Joined: 15 Apr 2009 Posts: 239 Location: Youtube watching Japanese Rock, and Korean Pop - Music Videos =)
|
|
Back to top |
|
 |
Womanizer Grandmaster Cheater
Reputation: 2
Joined: 30 May 2009 Posts: 958
|
Posted: Sat Jul 17, 2010 2:34 pm Post subject: |
|
|
I am trying to make two text boxes and one button. That button should post what was his name (that he puted on textbox1) and second his message. Than that should post it to my mail. But everytime i click send it shows me this window
|
|
Back to top |
|
 |
justa_dude Grandmaster Cheater
Reputation: 23
Joined: 29 Jun 2010 Posts: 891
|
Posted: Sat Jul 17, 2010 4:10 pm Post subject: |
|
|
Important question: from what mail SERVER do you wish the e-mail to originate?
|
|
Back to top |
|
 |
megajosh2 Expert Cheater
Reputation: -1
Joined: 15 Mar 2007 Posts: 151
|
Posted: Sun Jul 18, 2010 3:16 pm Post subject: |
|
|
Are you asking for a form to use as a frontend to some script, or an actual script to send an e-mail? HTML is not a scripting language.
|
|
Back to top |
|
 |
BOU Expert Cheater
Reputation: 0
Joined: 15 Apr 2009 Posts: 239 Location: Youtube watching Japanese Rock, and Korean Pop - Music Videos =)
|
|
Back to top |
|
 |
Lyfa The Lonely Man
Reputation: 12
Joined: 02 Nov 2008 Posts: 743
|
Posted: Thu Jul 22, 2010 10:13 pm Post subject: |
|
|
Made a quick PHP script:
Code: | <?php
/* ============================================ CONFIG ============================================ */
$email = "ENTER YOUR EMAIL HERE";
$subject = "ENTER YOUR MESSAGE'S SUBJECT HERE";
/* ============================================ CONFIG ============================================ */
if(!empty($_POST['message'])) {
$email_message = htmlspecialchars($_POST['message']);
$email_message = str_replace("
", "<br />", $email_message);
if(validateEmail($_POST['from']) == FALSE) {
die("Plese enter a valid email");
} else {
$from = $_POST['from'];
}
$mailheaders = "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-type: text/html; charset=iso-8859-1\r\n";
$mailheaders .= "From: Womanizer's Contact Form <[email protected]>\r\n";
$mailheaders .= "Reply-To: Visitor <".$from.">\r\n";
function validateEmail($email) {
if(eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,4}(\.[a-zA-Z]{2,3})?(\.[a-zA-Z]{2,3})?$', $email))
return true;
else
return false;
}
$mail = mail($email, $subject, $email_message, $mailheaders);
if($mail) {
echo "Your mail was sent successfully.";
} else {
echo "Oh no, something messed up";
}
} else {
?>
<form action="" method="POST">
<label for="from">Your Email: </label> <input type="text" name="from" /><br />
<label for="message">Your message:</label> <textarea rows="5" cols="20" name="message"></textarea><br />
<input type="submit" value="Contact" />
</form>
<?php
}
?> |
It's not super secure, but it works.
_________________
|
|
Back to top |
|
 |
BOU Expert Cheater
Reputation: 0
Joined: 15 Apr 2009 Posts: 239 Location: Youtube watching Japanese Rock, and Korean Pop - Music Videos =)
|
|
Back to top |
|
 |
Lyfa The Lonely Man
Reputation: 12
Joined: 02 Nov 2008 Posts: 743
|
Posted: Sat Jul 31, 2010 11:14 pm Post subject: |
|
|
JPU666 wrote: | F3ar wrote: | Made a quick PHP script:
Code: | <?php
/* ============================================ CONFIG ============================================ */
$email = "ENTER YOUR EMAIL HERE";
$subject = "ENTER YOUR MESSAGE'S SUBJECT HERE";
/* ============================================ CONFIG ============================================ */
<?php
}
?>...(shortened the code so this reply won't be so long....) |
It's not super secure, but it works. |
That looks good = :D , you can save the file (without the form code) as something like "send_email.php" and on the form, you can have the code <form action="send_email.php(or whatever you named it)" method="POST">
and btw f3ar, how did you get your localhost to be available online(i kinda think you are using apache, xampp, or wamp cause your domain is f3ar ,ath.cx and "ath.cx" is from Dyndns.com) | It's called port forwarding - http://portforward.com - Look for your router and follow the tutorial.
_________________
|
|
Back to top |
|
 |
|