sendmail.exe doesn't read sendmail.ini

Problems with the Windows version of XAMPP, questions, comments, and anything related.

sendmail.exe doesn't read sendmail.ini

Postby danothy » 01. September 2009 14:39

Afternoon all,

I wonder if anyone can give me some assistance with getting the php mail() function to work. When I execute a php mail() command it returns success but the email is not sent. I've had a search through the posts and most of the stuff on sendmail.ini is about it's configuration, of which I tried many permutations before i noticed this line cropping up in C:\Program Files\xampplite\apache\logs\error.log:

Code: Select all
sendmail.exe: C:\Program Files\xampplite\sendmail\sendmail.ini: line 1: unknown command ;

I tried removing the sendmail.ini comments etc. but it always seems to fall over at the first line, making me think that I've missed a step somewhere or there is some uncommon quirk with my system that I can't find documentation for. If anyone can tell me why this is happening / what I'm doing wrong I would be grateful.

my sendmail.ini file is (currently):

Code: Select all
; configuration for fake sendmail

; if this file doesn't exist, sendmail.exe will look for the settings in
; the registry, under HKLM\Software\Sendmail

[sendmail]

; you must change mail.mydomain.com to your smtp server,
; or to IIS's "pickup" directory.  (generally C:\Inetpub\mailroot\Pickup)
; emails delivered via IIS's pickup directory cause sendmail to
; run quicker, but you won't get error messages back to the calling
; application.

smtp_server=*****

; smtp port (normally 25)

smtp_port=*****

; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify

default_domain=*****

; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging

error_logfile=errors.txt

; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging

debug_logfile=debug.txt

; if your smtp server requires authentication, modify the following two lines

auth_username=*****
auth_password=*****

; if your smtp server uses pop3 before smtp authentication, modify the
; following three lines

;pop3_server=*****
;pop3_username=*****
;pop3_password=*****

; to force the sender to always be the following email address, uncomment and
; populate with a valid email address.  this will only affect the "MAIL FROM"
; command, it won't modify the "From: " header of the message content

force_sender=*****

; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting.  you can manually set the ehlo/helo name if required

;hostname=localhost

and the relevant part of my php.ini file is:

Code: Select all
[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP = mail.danothy.co.uk
; http://php.net/smtp-port
;smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = danothy@danothy.co.uk

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "\"C:\Program Files\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 = "C:\Program Files\xampplite\apache\logs\php_mail.log"

For background purposes, I'm using my PC (XP Home) as a development environment and as I go I am configuring the installation to match that of my host (they started off very similar to begin with anyway).

Thanks,

Dan.
danothy
 
Posts: 3
Joined: 01. September 2009 14:01

Re: sendmail.exe doesn't read sendmail.ini

Postby Wiedmann » 01. September 2009 15:01

my sendmail.ini file is (currently):

Which XAMPP version are you using?

Your "sendmail.ini" looks like XAMPP 1.7.1, but your "php.ini" looks like XAMPP 1.7.2 ...
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: sendmail.exe doesn't read sendmail.ini

Postby danothy » 01. September 2009 15:05

I am using XAMPP Lite 1.7.2
danothy
 
Posts: 3
Joined: 01. September 2009 14:01

Re: sendmail.exe doesn't read sendmail.ini

Postby Wiedmann » 01. September 2009 15:09

I am using XAMPP Lite 1.7.2

So you should first restore the original "sendmail.ini".
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: sendmail.exe doesn't read sendmail.ini

Postby danothy » 01. September 2009 15:20

I have now done that. I see the mistake I've made, thank you for catching that. On reflection it does seem a bit thick to replace the contents of an ini file with something of a different format. The restored version is:

Code: Select all
# Example for a user configuration file

# Set default values for all following accounts.
defaults
logfile "\xampplite\sendmail\sendmail.log"

# Mercury
account Mercury
host localhost
from postmaster@localhost
auth off

# A freemail service example
account Hotmail
tls on
tls_certcheck off
host smtp.live.com
from [exampleuser]@hotmail.com
auth on
user [exampleuser]@hotmail.com
password [examplepassword]

# Set a default account
account default : Mercury

I will experiment with the settings to see if I can get it to work.

Thanks for your help.

Dan.
danothy
 
Posts: 3
Joined: 01. September 2009 14:01

Re: sendmail.exe doesn't read sendmail.ini

Postby ldexterldesign » 02. November 2009 16:37

Has anyone got a working sendmail file they can post up? I'm having really difficulty getting mine to work today.

Do I have to touch my php.ini file *at all* from default (1.7.2.) to get sendmail to work?

Thanks,
ldexterldesign
 
Posts: 21
Joined: 23. July 2009 16:58

Re: sendmail.exe doesn't read sendmail.ini

Postby Izzy » 02. November 2009 23:22

ldexterldesign wrote:Has anyone got a working sendmail file they can post up? I'm having really difficulty getting mine to work today.
Perhaps it would be more use if you posted your own sendmail.ini file with the settings that don't work so it can be looked at - and obviously, please don't include your email password.

ldexterldesign wrote:Do I have to touch my php.ini file *at all* from default (1.7.2.) to get sendmail to work?
Yes, see the php.ini file the OP posted above as it has the required changes included which, in your case would only require the adding of the comment character ; to the beginning of the required lines- don't change the path to sendmail as it should already be correct for your installation.

An Advanced Search in forum XAMPP for Windows using keyword sendmail or msmtp should give good results.


BTW XAMPP versions before 1.7.2 used Fake Sendmail and since XAMPP version 1.7.2 the use of msmtp as a sendmail alternative is now in use.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: sendmail.exe doesn't read sendmail.ini

Postby ldexterldesign » 03. November 2009 09:36

Izzy wrote:
ldexterldesign wrote:Has anyone got a working sendmail file they can post up? I'm having really difficulty getting mine to work today.
Perhaps it would be more use if you posted your own sendmail.ini file with the settings that don't work so it can be looked at - and obviously, please don't include your email password.

ldexterldesign wrote:Do I have to touch my php.ini file *at all* from default (1.7.2.) to get sendmail to work?
Yes, see the php.ini file the OP posted above as it has the required changes included which, in your case would only require the adding of the comment character ; to the beginning of the required lines- don't change the path to sendmail as it should already be correct for your installation.

An Advanced Search in forum XAMPP for Windows using keyword sendmail or msmtp should give good results.


BTW XAMPP versions before 1.7.2 used Fake Sendmail and since XAMPP version 1.7.2 the use of msmtp as a sendmail alternative is now in use.


Hi Izzy,

Thanks for your reply.

Defaults:

php.ini
Code: Select all
[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 = "\"C:\xampp\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 = "C:\xampp\apache\logs\php_mail.log"


sendmail.ini
Code: Select all
# Example for a user configuration file

# Set default values for all following accounts.
defaults
logfile "\xampp\sendmail\sendmail.log"

# Mercury
account Mercury
host localhost
from postmaster@localhost
auth off

# A freemail service example
account Hotmail
tls on
tls_certcheck off
host smtp.live.com
from [exampleuser]@hotmail.com
auth on
user [exampleuser]@hotmail.com
password [examplepassword]

# Set a default account
account default : Mercury


My details are:

Code: Select all
SMTP: authsmtp.streamline.net
Email address: mail@ldexterldesign.co.uk
Password: x

Auth:
Username: mail@ldexterldesign.co.uk
Password: x


Tried every possible scenario. If you could attempt to fill in the blanks for me and post the correct code below I'd appreciate it. I gave up on this yesterday so anything you can add will be a bonus.

Many thanks,
ldexterldesign
 
Posts: 21
Joined: 23. July 2009 16:58

Re: sendmail.exe doesn't read sendmail.ini

Postby Izzy » 03. November 2009 10:22

Lewis, first make a Copy of php.ini and a Copy of sendmail.ini, the default original files before editing.

Your php.ini file mail section with the required corrections for using sendmail - save the file after editing then restart Apache.
Code: Select all
[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 = "\"C:\xampp\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 = "C:\xampp\apache\logs\php_mail.log"


Your sendmail.ini with your details added, save the file and restart Apache after editing - use plain or TLS/SSL (Transit Layer Security) not both for the same mail server to prevent confusion.
Code: Select all
# Set default values for all following accounts.
defaults
logfile "C:\xampp\sendmail\sendmail.log"

# secureldexterldesign email settings with TLS/SSL.
account secureldexterldesign
host authsmtp.streamline.net
from mail@ldexterldesign.co.uk
port 465
auth on
user mail@ldexterldesign.co.uk
password x
tls on
tls_starttls off
tls_certcheck off

# Set a default account
account default : secureldexterldesign


Replace or comment out the above TLS/SSL entry with this one below if you don't use TLS (but you should use TLS/SSL if it is available on your server - most now offer this facility).
Code: Select all
# plainldexterldesign email settings without TLS/SSL (Transit Layer Security).
account plainldexterldesign
host authsmtp.streamline.net
from mail@ldexterldesign.co.uk
port 25
auth on
user mail@ldexterldesign.co.uk
password x

# Set a default account
account default : plainldexterldesign
See how all that lot goes by testing your script's mail function - read the sendmail.log file if you have no success and if you don't understand the entries then paste them here so they can be checked out.

Good luck.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: sendmail.exe doesn't read sendmail.ini

Postby ldexterldesign » 03. November 2009 21:10

Hi mate,

Thanks for this. Got excited for a second at the prospect of it working, but no luck :[

See what you make of all this. I guess we can eliminate some things after all and go from there:

Code: Select all
Nov 03 19:06:03 host=authsmtp.streamline.net tls=on auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk errormsg='cannot connect to authsmtp.streamline.net, port 465: Unknown error' exitcode=EX_TEMPFAIL

Nov 03 19:09:09 host=authsmtp.streamline.net tls=off auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk errormsg='cannot connect to authsmtp.streamline.net, port 465: Unknown error' exitcode=EX_TEMPFAIL

Nov 03 19:11:28 host=authsmtp.streamline.net tls=off auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk errormsg='cannot connect to authsmtp.streamline.net, port 465: Unknown error' exitcode=EX_TEMPFAIL

Nov 03 19:13:01 host=authsmtp.streamline.net tls=off auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk smtpstatus=535 smtpmsg='535 authentication failed (#5.7.1)' errormsg='authentication failed (method CRAM-MD5)' exitcode=EX_NOPERM

Nov 03 19:14:25 host=authsmtp.streamline.net tls=off auth=off from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk smtpstatus=553 smtpmsg='553 sorry, that domain isn?t in my list of allowed rcpthosts (#5.7.1)' errormsg='recipient address mail@ldexterldesign.co.uk not accepted by the server' exitcode=EX_DATAERR

Nov 03 19:18:47 host=authsmtp.streamline.net tls=on auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk errormsg='cannot connect to authsmtp.streamline.net, port 465: Unknown error' exitcode=EX_TEMPFAIL

Nov 03 19:20:58 host=authsmtp.streamline.net tls=on auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk errormsg='cannot connect to authsmtp.streamline.net, port 465: Unknown error' exitcode=EX_TEMPFAIL

Nov 03 19:21:23 host=authsmtp.streamline.net tls=on auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk errormsg='TLS handshake failed: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol' exitcode=EX_IOERR

Nov 03 19:23:53 host=authsmtp.streamline.net tls=off auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk smtpstatus=535 smtpmsg='535 authentication failed (#5.7.1)' errormsg='authentication failed (method CRAM-MD5)' exitcode=EX_NOPERM

Nov 03 19:37:55 host=authsmtp.streamline.net tls=on auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk errormsg='cannot connect to authsmtp.streamline.net, port 465: Unknown error' exitcode=EX_TEMPFAIL

Nov 03 19:38:51 host=authsmtp.streamline.net tls=on auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk errormsg='TLS handshake failed: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol' exitcode=EX_IOERR

Nov 03 19:58:40 host=authsmtp.streamline.net tls=on auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk errormsg='the server does not support TLS via the STARTTLS command' exitcode=EX_UNAVAILABLE


Your help is much appreciated (I'll be sure to backup my php.ini and sendmail.ini files next time I format after this charade!)
ldexterldesign
 
Posts: 21
Joined: 23. July 2009 16:58

Re: sendmail.exe doesn't read sendmail.ini

Postby ldexterldesign » 03. November 2009 21:13

FYI I was playing around with all sorts of variables for the last hour. Hence the changing log errors ;]

Code: Select all
Nov 03 20:16:55 host=authsmtp.streamline.net tls=off auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk smtpstatus=535 smtpmsg='535 authentication failed (#5.7.1)' errormsg='authentication failed (method CRAM-MD5)' exitcode=EX_NOPERM

Nov 03 20:17:59 host=authsmtp.streamline.net tls=off auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk smtpstatus=535 smtpmsg='535 authentication failed (#5.7.1)' errormsg='authentication failed (method CRAM-MD5)' exitcode=EX_NOPERM


I'm pretty sure it's an authentication issue we're dealing with here. Should I contact my host?

I'm pulling these details right off their website as we speak:

Code: Select all
SMTP server: authsmtp.streamline.net
SMTP username: your email address (ie root@ldexterldesign.co.uk)
SMTP password: your password
SMTP port: 25
ldexterldesign
 
Posts: 21
Joined: 23. July 2009 16:58

Re: sendmail.exe doesn't read sendmail.ini

Postby Izzy » 03. November 2009 22:04

Izzy wrote:Replace or comment out the above TLS/SSL entry with this one below if you don't use TLS (but you should use TLS/SSL if it is available on your server - most now offer this facility).
Code: Select all
# plainldexterldesign email settings without TLS/SSL (Transit Layer Security).
account plainldexterldesign
host authsmtp.streamline.net
from mail@ldexterldesign.co.uk
port 25
auth on
user mail@ldexterldesign.co.uk
password x

# Set a default account
account default : plainldexterldesign
The above is the alternative to TLS which your host is not recognizing.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: sendmail.exe doesn't read sendmail.ini

Postby ldexterldesign » 04. November 2009 09:35

Morning Izzy,

Thanks for your continued help with this. With the following setup I'm still getting the following error message:

php.ini:
Code: Select all
[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 = "\"C:\xampp\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 = "C:\xampp\apache\logs\php_mail.log"


sendmail.ini:
Code: Select all
# Example for a user configuration file

# Set default values for all following accounts.
defaults
logfile "C:\xampp\sendmail\sendmail.log"

# plainldexterldesign email settings without TLS/SSL (Transit Layer Security).
account plainldexterldesign
host authsmtp.streamline.net
from mail@ldexterldesign.co.uk
port 25
auth on
user mail@ldexterldesign.co.uk
password x

# Set a default account
account default : plainldexterldesign


Error log:
Code: Select all
Nov 04 08:33:01 host=authsmtp.streamline.net tls=off auth=on user=mail@ldexterldesign.co.uk from=mail@ldexterldesign.co.uk recipients=mail@ldexterldesign.co.uk smtpstatus=535 smtpmsg='535 authentication failed (#5.7.1)' errormsg='authentication failed (method CRAM-MD5)' exitcode=EX_NOPERM


Any thoughts?

Many thanks,
ldexterldesign
 
Posts: 21
Joined: 23. July 2009 16:58

Re: sendmail.exe doesn't read sendmail.ini

Postby Izzy » 04. November 2009 09:45

Your php.ini is just fine so no need to post that again.


Not sure if this is required but it won't hurt and you will start to get into the habit of restarting the server components after editing ini and conf files - did you save the sendmail.ini file and restart Apache after editing also clear your browser's cache?


The authentication method is causing your email server (host) to chuck a wobbly.

Change auth on to auth plain

If that fails change to auth login

Don't change anything else other than the auth setting, save and restart Apache etc.

Also make absolutely certain that your password is correct.

See how you go as authentication method CRAM-MD5 is not being accepted by your host and this may be an automatic setting in sendmail when auth on is being used.

BTW your host is very much last century in it's attitude towards the secure transport of email and the secure transfer of user names and passwords - but this may well be intentional as IMHO all UK email is monitored.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: sendmail.exe doesn't read sendmail.ini

Postby ldexterldesign » 04. November 2009 12:02

Change auth on to auth plain


BANG!

Thanks so much dude. Drop me your Paypal and I'll flit you some beer $$$.
ldexterldesign
 
Posts: 21
Joined: 23. July 2009 16:58

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 48 guests