Jump to content

Trying to send an email to myself from some site comments


Speed D

Recommended Posts

<html>

<head><title>PHP Mail Sender</title></head>

<body>

<?php

 

$email = "[email protected]";

$subject = $HTTP_POST_VARS['name'];

$message = $HTTP_POST_VARS['comments'];

 

mail ($email,$subject,$message);

?>

</body>

</html>

 

still not working. thanks for the responses :)

Try this:

 

<?php
if(!empty($HTTP_POST_VARS['subject']))
{
$email = '[email protected]';
$subject = $HTTP_POST_VARS['subject'];
$message = $HTTP_POST_VARS['comment'];
mail($email,$subject,$message);
}
?>
<html>
<head><title>PHP Mail Sender</title></head>
<body>

<form action='' method='POST' name='mail_form'>
Subject: <input type='text' name='subject' /><br />
Comment: <input type='text' name='comment' /><br />

<button type='submit' name='submit'>Send Mail</button>
</form>

</body>
</html> 

yeah it should've been running on freehostia.

i think sendmail may have been disabled so i'd like to try a different tecnique.

The plan is to accept the information given to me and write it to a file then redirect to a thanks page.

<?php
header ('Location: http://thanks_page.com');
$handle = fopen("wasdkill.txt", "a");
foreach($_POST as $variable => $value) {
fwrite($handle, $variable);
fwrite($handle, "=");
fwrite($handle, $value);
fwrite($handle, "\r\n");
}
fwrite($ handle, "\r\n");
fclose($handle);
exit;
?>

I still fail so it's not showing up

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.