chaseman Posted February 5, 2011 Share Posted February 5, 2011 I've gotten hMail Server to work and I'm able to send emails locally, now I want to get my PHP scripts to send email, but I'm not quite sure how to set up the sendmail.ini so the PHP scripts send the emails correctly. This is how I have it now, I censored the confidential data out. # Example for a user configuration file # Set default values for all following accounts. defaults logfile "C:\xampp\xampp\sendmail\sendmail.log" # Mercury account Mercury host localhost from postmaster@localhost auth off # A freemail service example account Gmail tls on tls_certcheck off host smtp.gmail.com from ****@gmail.com auth on user ****@googlemail.com password **** # Set a default account account default : Mercury If I for example want it to use hMail instead of Mercury, what do I type in there? I hope some of the experts can chime in on this one. my hMail email is: [email protected] and the POP3 and SMTP IP I use is 127.0.0.1 Quote Link to comment https://forums.phpfreaks.com/topic/226774-how-to-setup-sendmailini-for-php-with-hmail-server/ Share on other sites More sharing options...
chaseman Posted February 5, 2011 Author Share Posted February 5, 2011 For everybody who is wondering the same question, if you configure your sendmail.ini to something like this: # Example for a user configuration file # Set default values for all following accounts. defaults logfile "C:\xampp\xampp\sendmail\sendmail.log" # hMail account hMail tls off tls_certcheck off host 127.0.0.1 from [email protected] auth on user [email protected] password ****** # A freemail service example account GoogleAccount tls on tls_certcheck off host smtp.gmail.com from [email protected] auth on user [email protected] password ****** # Set a default account account default : GoogleAccount Ignore the hMail part and concentrate on the Google part. And your php.ini to this: [mail function] ; For Win32 only. ; http://php.net/smtp ; SMTP = 127.0.0.1 ; http://php.net/smtp-port smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from sendmail_from = [email protected] It's important to have "SMTP = " commented out. Then you'll be able to simply use your google acount to send an email off your local computer to any other email address your want. You can simply test your PHP scripts without having to upload them. You also won't need hMail Server, since you're now using your Gmail account for it. Every email will be send from [email protected], to any email inserted into your PHP script on your Xampp server. It's enough for testing purposed. I couldn't accomplish this with hMail server, I would always get the error message "cannot use a secure authentication method" Quote Link to comment https://forums.phpfreaks.com/topic/226774-how-to-setup-sendmailini-for-php-with-hmail-server/#findComment-1170279 Share on other sites More sharing options...
chaseman Posted February 5, 2011 Author Share Posted February 5, 2011 Ok I got it working locally too now, I had to untick authentication in the hMail IP Ranges settings. Now I can use emails like [email protected], how nerdy lol. Quote Link to comment https://forums.phpfreaks.com/topic/226774-how-to-setup-sendmailini-for-php-with-hmail-server/#findComment-1170356 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.