php configuration settings

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

php configuration settings

Postby amanda099 » 09. September 2009 19:14

What should I modify the C:\xampp\php\php configuration settings file in order for the mail-notification function of my GuestBook to work ?
The current [mail function] is as follows:

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


Kindly Amanda Nguyen
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Re: php configuration settings

Postby Nobbie » 09. September 2009 19:55

amanda099 wrote:What should I modify the C:\xampp\php\php configuration settings file in order for the mail-notification function of my GuestBook to work ?


You should modify what the documentation of your Guestbook tells you to modify.
Nobbie
 
Posts: 8770
Joined: 09. March 2008 13:04

Re: php configuration settings

Postby Izzy » 09. September 2009 23:53

I am assuming you are using XAMPP 1.7.2 version if not then let me know which version you are using as the sendmail.ini is somewhat different in the older versions.

Normally if your mail provider does not require authentication you would edit your php.ini file like so in red but first always make a backup of the default of any .ini.or .conf file before editing.
php.ini wrote:[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = your.ISP.email
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = you@your.ISP.email
Save the file and restart Apache then try and send your email from your GB again...

...but if your ISP or any of your email providers requires that you authenticate by using a username/password to log in to get the mail and/or you want to use secure email then you would have to skip the above changes and comment out the whole of the For Win32 only sections and use the For Unix only Sendmail options as you can use only one of those, either the Win32 or the Sendmail options - Ignore the reference to Unix only as Sendmail is included in XAMPP for Windows and works just fine.
php.ini wrote:[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"

Next go to and open in your text editor C:\xampp\sendmail\sendmail.ini file.

Change these lines to suit your email provider.
sendmail.ini wrote:# Example for a user configuration file

# Set default values for all following accounts.
defaults
logfile "C:\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 you@hotmail.com
auth on
user you@hotmail.com
password yourhotmailpassword

# Set a default account
account default : Hotmail
Substitute your own email provider for the Hotmail example.
I have also commented out the Mercury references as, unless you use Mercury on a busy LAN then it is not required or recommended to use.

Save the file and restart Apache then try and send mail from your GB again.


BTW which GB are you using?
I found a great and possibly the best GB yet and it is absolutely free and well supported:
TalkBack2 by Richard Williamson (aka Old Guy)
http://www.scripts.oldguy.us/talkback
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: php configuration settings

Postby amanda099 » 10. September 2009 23:41

Yes, I'm using XAMPP 1.7.2 version. Thanks Izzy for your detailed explanation .

No Authentication Required option:
I don't really understand the your.ISP.email , is there another way you can explain that to me ?

Authentication Required option:
If I use Gmail instead of Hotmail, is the following code the right code in C:\xampp\sendmail\sendmail.ini file:
Code: Select all
# A freemail service example
account Gmail
tls on
tls_certcheck off
host smtp.live.com
from me@gmail.com
auth on
user me@gmail.com
password mygmailpassword
# Set a default account
account default : Gmail


A friend of mine provided me his GBscript, but I think I should consider TALKBACK. It seems to have many great features.

Kindly Amanda Nguyen
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Re: php configuration settings

Postby Izzy » 11. September 2009 00:27

Amanda wrote:No Authentication Required option:
I don't really understand the your.ISP.email , is there another way you can explain that to me ?
This is simply the Outgoing SMTP server at your Internet Service Provider - the one you use in your email client to fetch your email from your ISP account and is usually provided free with your ISP access account for example smtp.tiscali.dk

Amanda wrote:Authentication Required option:
If I use Gmail instead of Hotmail, is the following code the right code in C:\xampp\sendmail\sendmail.ini file:
You have the idea right but the only change needed is the host smtp.live.com item which should be the Gmail's SMTP server, which is again giving some confusion with naming conventions as host really means SMTP host which also means Outgoing Mail Server (SMTP) and in Gmail's case this may be something like you would configure your email client to and here is the settings from:
http://mail.google.com/support/bin/answ ... swer=13287

Google wrote:Outgoing Mail (SMTP) Server - requires TLS: smtp.gmail.com (use authentication)
Use Authentication: Yes
Use STARTTLS: Yes (some clients call this SSL)
Port: 465 or 587
So your sendmail.ini looks good except to change the host to smtp.gmail.comBTW if you have problems with sending mail using sendmail then the sendmail.log file in the sendmail folder should give details of the errors.


I think you will be more than satisfied with Talkback's features as sometimes GB scripts can be unsafe and magnets for spam.

Also for your web design tool kit the highly configurable, safe with anti-spam feature rich php form script is by far FormMail from http://www.tectite.com/ and again there is a free and a paid version, the free version does what I want and expect a form to do (I use it on my CCM web site below) with the paid version having more sophisticated features if required and the support is also excellent.

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

Re: php configuration settings

Postby amanda099 » 11. September 2009 23:33

Hi Izzy !

I managed to identify my ISP's Outgoing SMTP server and make the mail function work using the 1.option (no authentication required).

But my preference is the 2.option (ISP's authentication required) because I could then use my email of my choice. But for some reason it doesnt work for me.

The code I used is:

In C:\xampp\php\php configuration 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 = "\"C:\xampp\sendmail\sendmail.exe\" -t"


In C:\xampp\sendmail\sendmail.log
Code: Select all
# Example for a user configuration file

# Set default values for all following accounts.
defaults
logfile "C:\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 ***@gmail.com
password mygmailpassword

# Set a default account
account default : Gmail


I include the error log ( C:/xampp/sendmail/sendmail.log ) also:

Code: Select all
Sep 12 09:53:35 host=smtp.gmail.com tls=on auth=on user=***@gmail.com from=***@gmail.com recipients=***@gmail.com errormsg='the server does not support TLS via the STARTTLS command' exitcode=EX_UNAVAILABLE
Sep 12 09:54:12 host=smtp.gmail.com tls=on auth=on user=***@gmail.com from=***@gmail.com recipients=myyahoomail@yahoo.com errormsg='the server does not support TLS via the STARTTLS command' exitcode=EX_UNAVAILABLE


Perhaps you can identify a problematic area in the code .

Again Thank you for your very detailed help, I have learnt a lot already.

P.S. Where in your CCM Website might I see a working demo of FormMail ?

Amanda
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05

Re: php configuration settings

Postby Izzy » 12. September 2009 01:55

It would seem that Google and it's Gmail has decided to do things differently to everyone else when it come to secure email.

I don't have Gmail, Hotmail or even Coldmail :) for that matter as I have found a much better alternative at lavabit.com which has a very useful free service.



Here is a comment from the author of Fake Sendmail for Windows, Byron Jones, on his web site http://glob.com.au/sendmail/
some people have has performance issues using my fake sendmail with gmail's smtp servers (due to SSL/TLS). msmtp may be a viable alternative to fake sendmail.
So you may like to try the recommended msmtp alternative http://msmtp.sourceforge.net/ (the link also is in the above quote) if you still would like to use Gmail and why not if you can get it to work for your needs using any alternative method available - I have not tested msmtp so can't help you there but if you get it working and it helps then perhaps you could do a mini how-to in this topic so it might help other Gmail users here.

Perhaps the developers of XAMPP for Windows might like this msmtp as an alternative to fake sendmail that seems to give many XAMPP users of free email a headache.

Amanda, just as an aside if you download the latest sendmail archive (zip) from the above author's site http://www.glob.com.au/sendmail/sendmail.zip and unpack it into the same location as the original sendmail after first renaming the original sendmail folder to sendmail_orig for example, then you will see a much more verbose sendmail.ini file that you may be able to get a handle on and change some of the SSL/TLS items to see if you can get it to work with Gmail, the Google link in my post above may help with configuration issues.

This link may also help config the original sendmail.ini file for Gmail:
configuring-php-under-windows-use-gmail-external-smtp-server-ssl

You will have to copy over to your new clean unaltered version sendmail folder 2 files for SSL and they are libeay32.dll and ssleay32.dll or download from the author's web site the ssl archive and extract it to your new sendmail folder in the xampp folder tree - http://glob.com.au/sendmail/sendmail-SSL.zip

It would appear that the fake sendmail in XAMPP 1.7.2 has been configured or altered by the XAMPP developers using the available Delphi 2007 source code found in the original archive, with perhaps the assumption that the changes will make the chore of configuring sendmail easier, as the included sendmail.ini file in XAMPP 1.7.2 looks somewhat different to the original sendmail.ini included in the original download archive.

Sorry I can't be of more help and I wish you good luck in trying to get Gmail to work for your needs and I know you will give it your best shot.



Amanda wrote:P.S. Where in your CCM Website might I see a working demo of FormMail ?
CCM is an acronym of Chermside Court Motel and the form is in the main menu as Booking Enquiry - you will need to trust my site and have JavaScript enabled to see the form's many little features.
Last edited by Izzy on 12. September 2009 02:17, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: php configuration settings

Postby Wiedmann » 12. September 2009 02:14

Izzy wrote:It would appear that the fake sendmail in XAMPP 1.7.2 has been configured or altered by the XAMPP developers using the available source code found in the original archive, with perhaps the assumption that the changes will make the chore of configuring sendmail easier, as the included sendmail.ini file in XAMPP 1.7.2 looks somewhat different to the original sendmail.ini included in the original download archive.

XAMPP is using "msmtp". (see readme_en.txt or xampp-changes.txt)


amanda099 wrote:
Code: Select all
# A freemail service example
account Gmail
tls on
tls_certcheck off

errormsg='the server does not support TLS via the STARTTLS command'

Add a:
Code: Select all
tls_starttls off
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: php configuration settings

Postby Izzy » 12. September 2009 02:45

wiedmann wrote:XAMPP is using "msmtp".

So XAMPP is not using Fake Sendmail for Windows in XAMPP 1.7.2 from beta 2 but is now using msmtp in the 'sendmail' folder instead.

Again the lack of documentation to configure msmtp correctly has vaporised and is reliant on one's crystal ball to figure it out (or read the xampp-changes.txt file for clues to these changes but no links or docs anywhere - do a search of the xampp installation folder for msmtp).



For Amanda and those others interested in the documentation it can be find on the msmtp web site instead of in the sendmail (msmtp) folder - both a PDF and a HTML version of the manual are available.
http://msmtp.sourceforge.net/
http://msmtp.sourceforge.net/documentation.html

You will find a list of the ini configuration commands in 2 Configuration files in the HTML version of the manual.

This may also be of help for Gmail users found under 4 Transport Layer Security
For the Gmail SMTP server, you first issue the following command:

$ msmtp --serverinfo --host=smtp.gmail.com --tls=on --port=587 \
--tls-certcheck=off

The option ‘--port=587’ is specific to Gmail and should not be used with other servers. The option ‘--tls-certcheck=off’ allows msmtp to accept any certificate, so that it can print some information about it.
so in effect, Amanda, if you add the line in red
# A freemail service example
account Gmail
tls on
port 587
tls_certcheck off
host smtp.gmail.com
from ***@gmail.com
auth on
user ***@gmail.com
password mygmailpassword
to the original XAMPP (msmtp) sendmail.ini file it may also work for your Gmail needs.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: php configuration settings

Postby amanda099 » 14. September 2009 16:14

I'm learning plenty ! Awesome guys ! The mail things have generated a goodly amount of chatter ! The following options worked for my case :

Option 1
Code: Select all
# A freemail service example
account Gmail
tls on
tls_certcheck off
tls_starttls off
host smtp.gmail.com
from ***@gmail.com
auth on
user ***@gmail.com
password mygmailpassword

# Set a default account
account default : Gmail


Option 2
Code: Select all
# A freemail service example
account Gmail
tls on
port 587
tls_certcheck off
host smtp.gmail.com
from ***@gmail.com
auth on
user ***@gmail.com
password mygmailpassword

# Set a default account
account default : Gmail


Thank you both : Izzy & Wiedmann muchly !
As an aside : What effective opensource database search script would you fine Gentlemen recommend to me ?
Kindly Amanda
amanda099
 
Posts: 41
Joined: 02. September 2009 15:05


Return to XAMPP for Windows

Who is online

Users browsing this forum: Bonniem and 65 guests