email sender script help
Started on the old forum in July 2010 · view the original in the archive · old links redirect here
Sending email with php is not a big deal try the script below create a file mailform.php and paste the code below ,replace someone@example.com with you email
<html>
<body>
<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
{
//send email
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail( "someone@example.com", "Subject: $subject",
$message, "From: $email" );
echo "Thank you for using our mail form";
}
else
//if "email" is not filled out, display the form
{
echo "<form method='post' action='mailform.php'>
Email: <input name='email' type='text' /><br />
Subject: <input name='subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>";
}
?>
</body>
</html>
Jerson wrote: not working haha
<?php
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">';
echo "<head>";
echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />";
echo "<title>Sitename | E-mail</title>";
echo "<meta name=\"description\" content=\"emailer\" />";
echo "</head><body>";
echo "<div align=\"center\">";
echo"<br/><br/>Emailer :)<br/><br/><br/>";
?>
<form action="<? echo $_POST['self']; ?>" method="post">
<input name="subject" type="text" value="-=subject=-" size="21" maxlength="30"><br>
<input name="email" type="text" value="-=receiver=-" size="21" maxlength="35"><br>
<textarea name="message" cols="17" rows="7">-=message=-</textarea><br>
<input name="send" type="submit" value="Send">
</form>
<?
if (@$_POST['send']=="Send")
{
$email=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['message'];
mail($email, $subject, $message);
echo "Sent to adress: <br/><i>$email</i>";
echo "<br/><br/>";
echo "<a href=\"index.php\">Send another E-mail</a>";
}
echo "</div>";
echo "</body></html>";
?>
not safe, not nice coding, but surelly sends email
It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!