Speed D Posted August 31, 2010 Share Posted August 31, 2010 <html> <head><title>PHP Mail Sender</title></head> <body> <?php $email = '[email protected]'; $subject = $HTTP_POST_VARS['name']; $message = $HTTP_POST_VARS['comment']; mail($email,$subject,$message) ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/212201-trying-to-send-an-email-to-myself-from-some-site-comments/ Share on other sites More sharing options...
premiso Posted August 31, 2010 Share Posted August 31, 2010 Is there any error information etc? What is the problem exactly? Link to comment https://forums.phpfreaks.com/topic/212201-trying-to-send-an-email-to-myself-from-some-site-comments/#findComment-1105734 Share on other sites More sharing options...
jayarsee Posted August 31, 2010 Share Posted August 31, 2010 There is no terminating semicolon at the end of your mail() function call. Link to comment https://forums.phpfreaks.com/topic/212201-trying-to-send-an-email-to-myself-from-some-site-comments/#findComment-1105736 Share on other sites More sharing options...
Speed D Posted August 31, 2010 Author Share Posted August 31, 2010 <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 Link to comment https://forums.phpfreaks.com/topic/212201-trying-to-send-an-email-to-myself-from-some-site-comments/#findComment-1105738 Share on other sites More sharing options...
jayarsee Posted August 31, 2010 Share Posted August 31, 2010 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> Link to comment https://forums.phpfreaks.com/topic/212201-trying-to-send-an-email-to-myself-from-some-site-comments/#findComment-1105739 Share on other sites More sharing options...
Speed D Posted August 31, 2010 Author Share Posted August 31, 2010 I just saved that as a html and it didn't send me an email Link to comment https://forums.phpfreaks.com/topic/212201-trying-to-send-an-email-to-myself-from-some-site-comments/#findComment-1105749 Share on other sites More sharing options...
Rifts Posted August 31, 2010 Share Posted August 31, 2010 save it as php... Link to comment https://forums.phpfreaks.com/topic/212201-trying-to-send-an-email-to-myself-from-some-site-comments/#findComment-1105764 Share on other sites More sharing options...
Speed D Posted September 1, 2010 Author Share Posted September 1, 2010 still no luck Link to comment https://forums.phpfreaks.com/topic/212201-trying-to-send-an-email-to-myself-from-some-site-comments/#findComment-1105884 Share on other sites More sharing options...
Rifts Posted September 1, 2010 Share Posted September 1, 2010 are you running it on a server? Link to comment https://forums.phpfreaks.com/topic/212201-trying-to-send-an-email-to-myself-from-some-site-comments/#findComment-1105890 Share on other sites More sharing options...
Speed D Posted September 1, 2010 Author Share Posted September 1, 2010 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 Link to comment https://forums.phpfreaks.com/topic/212201-trying-to-send-an-email-to-myself-from-some-site-comments/#findComment-1105915 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.