nick_whitmarsh Posted March 5, 2007 Share Posted March 5, 2007 Hi all, I am trying to write a simple feebback form. It all appears to work apart from it does not send an email. <?php $username = $_POST['username']; $useraddr = $_POST['useraddr']; $comments = $_POST['comments']; $to = "e9098022@bournemouth.ac.uk"; $re = "Website Feedback"; $msg = $comments; mail( $to, $re, $msg ); ?> <html> <head><title>Message Received</title></head> <body> <h3>Thanks for your comments</h3> Message received from <?php echo ( $username ); ?> <br /> Reply to <?php echo( $useraddr ); ?> </body> </html> ; For Win32 only. SMTP = smtp@hotmail.com smtp_port = 25 ; For Win32 only. sendmail_from = readingfc_fan@hotmail.com I have also put my php.ini code, could anyone please help me. Nick Quote Link to comment Share on other sites More sharing options...
Orio Posted March 5, 2007 Share Posted March 5, 2007 <?php if(!mail( $to, $re, $msg )) echo "PHP problem"; else echo "Problem with your spam filter probably..."; ?> What does it echo? Orio. Quote Link to comment Share on other sites More sharing options...
nick_whitmarsh Posted March 5, 2007 Author Share Posted March 5, 2007 It gives me a php problem!! Quote Link to comment Share on other sites More sharing options...
Orio Posted March 5, 2007 Share Posted March 5, 2007 I don't know much about how do you configure the mail() function, but let's try something else before- adding a from header: <?php if(!mail( $to, $re, $msg, "From: readingfc_fan@hotmail.com" )) echo "PHP problem"; else echo "Problem with your spam filter probably..."; ?> Is it still giving you "PHP problem"? Orio. Quote Link to comment Share on other sites More sharing options...
nick_whitmarsh Posted March 5, 2007 Author Share Posted March 5, 2007 Yeah it still gives me the annoying php problem, and still hasnt sent the email. Nick Quote Link to comment Share on other sites More sharing options...
Orio Posted March 5, 2007 Share Posted March 5, 2007 As I said, I don't know much from here on. Maybe wait for someone else... Sorry Orio. Quote Link to comment Share on other sites More sharing options...
nick_whitmarsh Posted March 5, 2007 Author Share Posted March 5, 2007 ok cheers anyway mate, hopefully somone else can then :-\ nick Quote Link to comment Share on other sites More sharing options...
Greaser9780 Posted March 5, 2007 Share Posted March 5, 2007 You need to tell it where to mail FROM Quote Link to comment Share on other sites More sharing options...
nick_whitmarsh Posted March 5, 2007 Author Share Posted March 5, 2007 It does say where it mails from, its in the $useraddr string. They type it in themselves on my form. Nick Quote Link to comment Share on other sites More sharing options...
Greaser9780 Posted March 5, 2007 Share Posted March 5, 2007 You need to include that in the mail function: mail( $to, $re, $msg, $useraddr ); Quote Link to comment Share on other sites More sharing options...
nick_whitmarsh Posted March 5, 2007 Author Share Posted March 5, 2007 Ok, I tried that but it still does not send an email I dont get this now. Nick Quote Link to comment Share on other sites More sharing options...
Greaser9780 Posted March 5, 2007 Share Posted March 5, 2007 This is what I use: mail($email, $subject, $message, "From: <admin@blahblahblah.com>\nX-Mailer: PHP/" . phpversion()); Quote Link to comment Share on other sites More sharing options...
nick_whitmarsh Posted March 5, 2007 Author Share Posted March 5, 2007 Tried that too, but it still does not want to send an email. Nick Quote Link to comment Share on other sites More sharing options...
Greaser9780 Posted March 5, 2007 Share Posted March 5, 2007 I don't get it either the code I gave you always works for me. Hopefully someone else can help ya out. Quote Link to comment Share on other sites More sharing options...
redarrow Posted March 5, 2007 Share Posted March 5, 2007 Look at your php.ini is it set correctly? Quote Link to comment Share on other sites More sharing options...
nick_whitmarsh Posted March 5, 2007 Author Share Posted March 5, 2007 I belive it is set correctly. Other features work that I have tried though. Heres my code anyway, ; For Win32 only. SMTP = smtp@hotmail.com smtp_port = 25 ; For Win32 only. sendmail_from = readingfc_fan@hotmail.com Quote Link to comment Share on other sites More sharing options...
redarrow Posted March 5, 2007 Share Posted March 5, 2007 I dont think you can use hotmail anymore to do this not sure look it up on google. your best bet is to setup the email as the email you was given from your isp ok hot mail see all mail as spam and blocks this ok. example[mail function] ; Setup for Windows systems SMTP = smtp.my.isp.net sendmail_from = me@myserver.com read this please http://www.sitepoint.com/article/advanced-email-php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.