mrherman Posted January 5, 2011 Share Posted January 5, 2011 Hi, folks -- I've been working on this for quite awhile, and have done lots of searching, but I still cannot make it work. Using Xampp on Win 7 x64, with PHP 5.3. Here is my simple PHP code just trying to get something to work: $to = '[email protected]'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [email protected]' ; mail($to, $subject, $message, $headers); ?> (NOTE: "my_real_email" is set to my actual email address.) Here are my php.ini settings: [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from ; sendmail_from = postmaster@localhost ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path sendmail_path = "\"E:\xampplite\sendmail\sendmail.exe\" -t" ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ; mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename mail.add_x_header = Off ; Log all mail() calls including the full path of the script, line #, to address and headers mail.log = "E:\xampplite\apache\logs\php_mail.log" I'm not getting an error and the email seems to be getting "logged", but I do not receive an actual email in my account. Thanks for any suggestions. Quote Link to comment https://forums.phpfreaks.com/topic/223520-cannot-get-a-simple-email-to-work-from-localhost/ Share on other sites More sharing options...
Zurev Posted January 5, 2011 Share Posted January 5, 2011 I'm going to go ahead and assume your ISP doesn't support your own smtp server, try uploading the script to a website and see if it works. Quote Link to comment https://forums.phpfreaks.com/topic/223520-cannot-get-a-simple-email-to-work-from-localhost/#findComment-1155384 Share on other sites More sharing options...
mrherman Posted January 5, 2011 Author Share Posted January 5, 2011 Thank you, Zurev. I don't actually have a website, just a learner right now using localhost. I may not have understood what you meant..? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/223520-cannot-get-a-simple-email-to-work-from-localhost/#findComment-1155393 Share on other sites More sharing options...
Rifts Posted January 6, 2011 Share Posted January 6, 2011 short version: you cant send mail with localhost Quote Link to comment https://forums.phpfreaks.com/topic/223520-cannot-get-a-simple-email-to-work-from-localhost/#findComment-1155808 Share on other sites More sharing options...
Pikachu2000 Posted January 6, 2011 Share Posted January 6, 2011 Yes you can, if you have a properly configured mail server, and your ISP allows it, among other things. Quote Link to comment https://forums.phpfreaks.com/topic/223520-cannot-get-a-simple-email-to-work-from-localhost/#findComment-1155814 Share on other sites More sharing options...
PFMaBiSmAd Posted January 6, 2011 Share Posted January 6, 2011 See this post and the whole thread it is part of - http://www.phpfreaks.com/forums/php-installation-configuration/mail-function-not-working-319686/msg1506752/#msg1506752 Quote Link to comment https://forums.phpfreaks.com/topic/223520-cannot-get-a-simple-email-to-work-from-localhost/#findComment-1155815 Share on other sites More sharing options...
mrherman Posted January 7, 2011 Author Share Posted January 7, 2011 Well, thanks, everyone! I spent a lot of time experimenting, etc., and never could get any configuration to work. Now I know why. Happy New Year! David Quote Link to comment https://forums.phpfreaks.com/topic/223520-cannot-get-a-simple-email-to-work-from-localhost/#findComment-1155999 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.