Cant get sendmail to work

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

Cant get sendmail to work

Postby TJHuntington » 25. November 2011 21:39

Hello,

I have followed some advice i was given a while ago and spent some time searching for answers but still cant get sendmail to work. If anyone can help that would be great. apollo and timhuntington resolve to the same ip and I have tried using apollo in both places. The error i keep getting is 'connect time out'. I have asked my host for instructions and have followed them by using apollo and username and password for a mailbox i set up.

sendmail config:
; 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=apollo

; smtp port (normally 25)

smtp_port=25

; 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= Not needed
; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging

error_logfile=error.log

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

debug_logfile=debug.log

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

auth_username= contact@timhuntington
auth_password= SECRET
; 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=me@localhost

; 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



php config file mail function section:
[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"



Any help appreciated,
Tim
Last edited by Sharley on 25. November 2011 22:11, edited 1 time in total.
Reason: I have obfuscated your real domain names which should not be included for your security and to prevent their being confused as a spam post.
TJHuntington
 
Posts: 5
Joined: 06. August 2011 14:08
Operating System: Windows 7 Home Premium 64bit

Re: Cant get sendmail to work

Postby Sharley » 25. November 2011 22:05

In the sendmail.ini this should be uncommented and the email address related to the smtp_server (apollo) added
Code: Select all
;force_sender=me@localhost
.

Your php.ini section should look like this as you are using fake sendmail only
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"
Read the log files in the sendmail folder if you are having issues with sending mail.

The fake sendmail included in 1.7.4 is an old version.

Download sendmail latest version from here:
http://www.glob.com.au/sendmail/sendmail.zip

Extract (drag) the following into your sendmail folder and overwrite or rename the original files:
sendmail.exe
sendmail.ini
libeay32.dll
ssleay.dll

Here is a link of many that have had success using the new version.
viewtopic.php?f=16&t=48847
viewtopic.php?f=16&t=49043

Issues related to the use of version 1.7.4 can be found in this topic:
viewtopic.php?f=16&t=44327
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Cant get sendmail to work

Postby TJHuntington » 26. November 2011 21:07

Hi Sharley,

I have uninstalled xampp and have installed the latest version but i still get a time out error. I have edited the force_sender line as you suggested. I have not downloaded the latest sendmail as i have installed the latest XAMPP so I'm guessing I no longer need to. My XAMPP version is now 1.7.7 . I forgot to mention on my profile than my win7 is 64bit. My config files are now as follows:
send mail config:
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=apollo

; smtp port (normally 25)

smtp_port=25

; 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=local

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

error_logfile=error.log

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

debug_logfile=debug.log

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

auth_username= contact@timhuntington
auth_password= SECRET
; 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=contact@timhuntington

; 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



php config mail function:
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 = "\xampp\php\logs\php_mail.log"


Any help appreciated.
Tim
TJHuntington
 
Posts: 5
Joined: 06. August 2011 14:08
Operating System: Windows 7 Home Premium 64bit

Re: Cant get sendmail to work

Postby Sharley » 26. November 2011 22:19

I have not downloaded the latest sendmail as i have installed the latest XAMPP so I'm guessing I no longer need to
Incorrect you still need to download the latest fake sendmail - the latest XAMPP 1.7.7 version still has the old fake sendmail version.

I have also obfuscated your real domain names - again. :shock:

I will not look at your issue until you implement the php.ini file recommendations I provided and you have updated your fake sendmail version.

All the help you need is here:
sendmail
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Cant get sendmail to work

Postby TJHuntington » 27. November 2011 19:36

Hi Sharley,

I have adjusted the php.ini as you suggested after having not initially noticed the two lines you commented out.
I have also updated the sendmail as you suggested although I may have configured the sendmail incorrectly or may have to make some additions as there are some differences so i have added the force_sender as you suggested and have also added a default_domain as the readme says to. I have also temoparily disabled my firewall but unfortunately i still get the connection timed out error.

php mail function config:
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 = "\xampp\php\logs\php_mail.log"


sendmail config:
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=apollo

; smtp port (normally 25)

smtp_port=25

; SMTPS (SSL) support
;   auto = use SSL for port 465, otherwise try to use TLS
;   ssl  = alway use SSL
;   tls  = always use TLS
;   none = never try to use SSL

smtp_ssl=auto

; 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=timhuntington

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

error_logfile=error.log

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

debug_logfile=debug.log

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

auth_username= contact@timhuntington
auth_password= SECRET
; if your smtp server uses pop3 before smtp authentication, modify the
; following three lines.  do not enable unless it is required.

pop3_server=
pop3_username=
pop3_password=

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

force_sender= contact@timhuntington

; force the sender to always be the following email address
; this will only affect the "RCTP TO" command, it won't modify
; the "To: " header of the message content

force_recipient=

; 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=



Any help appreciated.

Tim
TJHuntington
 
Posts: 5
Joined: 06. August 2011 14:08
Operating System: Windows 7 Home Premium 64bit

Re: Cant get sendmail to work

Postby Sharley » 27. November 2011 23:02

Can you send and receive email using those same sendmail.ini credentials in your normal Windows email client?

What is in the error.log file and the debug.log file?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 38 guests