We set up a formmail.php script to send email from a form on a site. We are able to receive mail to a hotmail account but not to an account on the mail server set up using ISPConfig. The following is the .php script we used: <?php //echo "<html><body>"; $recipient=$_POST["recipient"]; $subject=$_POST["subject"]; $whofrom=$_POST["Email"]; while (list ($key, $val) = each ($_POST)){ $message=$message."".$key.": ".$val."\r\n"; } mail ($recipient, $subject, $message,"From: ".$whofrom."\r\nReply-To: ".$whofrom."\r\n"); //echo "Sending mail..."; //echo "</body></html>"; ?>
Did you get any errors in the mail log? By the way, dont use scripts like this. It can be easily exploited by spammers to use your server as spam relay. Check every variable with a regular expression if they contain valid content.
You can do it with SSH. If you are on Windows, download PuTTY and connect to your server on port 22. Afterwards, you're on your server's command line as usual.
Where do I find the mail log once I log on using SSH? How do I pull it up and see if there are errors?
logs on debian: /var/log/mail.log so: cat /var/log/mail.log or pico /var/log/mail.log also nice is tail -F /var/log/mail.log This nice if you are testing, it shows the ongoing(new entries) updates of the file..
Login with SSH, then execute: ls /var/log/ you now get a list of your log files. The most common names for the mail log are: mail.log mail.info or just: mail
Thanks for all the help. I have another question: when I pull this up using pico or cat, how do I copy the text to the clipboard, so I can sift through it using Windows? Is there a simply copy and paste command? cp copies it to a specific destination, right? . . . not to a clipboard that can be pasted anywhere. Thanks.
If you use putty, just mark the text part wirg your mouse cursor. Putty copies the marked text to the clipboard automatically.