Paul Posted September 23, 2014 Share Posted September 23, 2014 Hi all,I've written the following very simple piece of code. <?php echo' <h1>Your emails</h1> '; $to = 'demoPHP@localhost.com'; $subject = 'Email testing'; $message = 'test'; mail($to, $subject, $message); ?> The email doesn't arrive in Thunderbird using Mercury Mail in XAMPP on Windows. The text 'Your emails' appears in the browser so I know the file is being processed by PHP. I can send an email using Thunderbird from 'demoPHP@localhost.com' to 'demoPHP@localhost.com' and it arrives in the inbox OK, so I know that Mercury is configured OK in that it's sending emails. I've changed the php.ini file to the following: [mail function]; For Win32 only.; http://php.net/smtpSMTP = localhost; http://php.net/smtp-portsmtp_port = 25; For Win32 only.; http://php.net/sendmail-from;sendmail_from = postmaster@localhost.com Does anyone have any ideas what I'm doing wrong. I'm actually running a Windows 64bit system. Would that make any difference? I'm referring to the fact that the php.ini file refers to 'Win32'. Thanks Paul Link to comment Share on other sites More sharing options...
Larry Posted September 25, 2014 Share Posted September 25, 2014 Hey Paul. I'd love to help here, but I don't use Windows much and I pretty much never worry about sending email from localhost, so I'm no good on this subject. Hopefully someone else will have some ideas. Link to comment Share on other sites More sharing options...
Paul Posted September 25, 2014 Author Share Posted September 25, 2014 No problem Larry. However, if you don't use localhost to test your email coding what do you use? My 'plan B' was to upload the code to a stand-alone page on my own live site and test it there. Obviously a bit more of a phaff because there's more chance of me winning a Nobel prize for PHP coding than my code working first time which means going backwards and forwards with FTPs. Cheers Paul Link to comment Share on other sites More sharing options...
Larry Posted September 26, 2014 Share Posted September 26, 2014 I don't test my email stuff until it's on the live site, normally. Sending out an email from a live server pretty much never has problems. So I'll make sure everything else is working and then make sure the email sending is working as my last rounds of tests on my live server. Link to comment Share on other sites More sharing options...
MichaelSpeds Posted September 30, 2017 Share Posted September 30, 2017 As mentioned in previous post, the continuous high server load caused another issue that PHP mail function in Wordpress failed to work, not very sure why does this occur maybe some timeout settings of PHP mail? Link to comment Share on other sites More sharing options...
Recommended Posts