Ok... well here is one of the scripts I have been trying to get working...
it works fine except it wont sent the message to my email in html format...
the form is here:
<form action="sendmail.php" method="post">
Name: <input type="text" name="newfname" /><br />
Email: <input type="text" name="newemail" /><br />
Message: <input type="text" name="newmessage" /><br />
<input type="submit" name="submit_form" value="Submit" />
</form>
and the sendmail.php is here:
<?php
if (!isset($_POST['submit_form'])):
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0"> <form action="<?=$HTTP_SERVER_VARS['PHP_SELF']?>" method="post"> Name:<input type="text" name="newfname" size="35" value=""><br>
Email:<input type="text" name="newemail" size="35" value=""><br> <input type="submit" name="submit_form" value=""> </form> </body> </html> <?php else:
$newfname = $_POST['newfname'];
$newemail = $_POST['newemail'];
$qc = $_POST['qc'];
// Send html autoresponder email or whatever $to = $newemail; $subject = "Dear $newfname, thank you for subscribing";
$message = "
<html>
<head>
<title></title>
</head>
<body>
<font style=\"font-family:tahoma, arial, verdana;font-size:10pt\"> Dear $newfname, <p>Thank you and whatever else I want this to say</p>
</font>
</body>
</html>
";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .="From:CHRIS <example@example.com>\r\n"; mail($newemail, $subject, $message, $headers); // Done sending autoresponder $date = date("F j, Y, g:i a" ); // Notify the new submission to the administrator $to = "example@example.com"; $subject = "Subscribe Me please";
$message = "
<h1>The following submission has been received.</h1>
<span style='font-weight:bold'>Name:</span> $newfname $newlname
<span style='font-weight:bold'>Email:</span> $newemail
$qc
<h2>Bottom of page</h2>
";
$header = "From:My Newsletter <example@example.com>";
mail($newemail, $subject, $message, $header);
// Done notifying to administrator
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
<font style="font-family:tahoma, arial, verdana;font-size:10pt">
Dear <?=$newfname?>,
<h1>Thank you for subscribing. Someone will probably get in touch with you sometime<//h1>
</font>
</body>
</html>
<?php endif; ?>
if you want to see this script in action goto http://www.350finale.co.nz/admin/email
Cheers