Jump to content

How to Setup sendmail.ini for PHP with hMail Server?


chaseman

Recommended Posts

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: mail@phpmail.local

and the POP3 and SMTP IP I use is 127.0.0.1

Link to comment
Share on other sites

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 mail@phpmail.local
auth on
user mail@phpmail.local
password ******



# A freemail service example
account GoogleAccount
tls on
tls_certcheck off
host smtp.gmail.com
from mymail@googlemail.com
auth on
user mymail@googlemail.com
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 = mymail@google.com

 

 

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 mymail@google.com, 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"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.