Page 1 of 1

sendmail not working

PostPosted: 27. December 2012 14:43
by brergo
I have literally spent several hours scouring forums, etc. for how to set up sendmail when using XAMPP. On my one system I got it working (the older versions of XAMPP and PHP). On another system, using the exact same setting/config, it won't work. Here is a comparison of the systems' specs, the working one being the one on the left:

Win XP SP3..........Win 7 Pro 64-bit
XAMPP 1.7.3.........XAMPP 1.8.0
PHP 5.3.1............PHP 5.4.4

Here is the sendmail.ini file;
# 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

# Gmail
account Gmail
tls on
port 587
tls_certcheck off
host smtp.gmail.com
from myemail@mydomain.com
auth on
user myemail@mydomain.com
password ********

# Set a default account
account default : Gmail


And here is the mail_function settings in php.ini:
[mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP = smtp.gmail.com
smtp_port = 587
mail.log = "C:\xampp\sendmail\sendmail.log"

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = myemail@mydomain.com

; XAMPP IMPORTANT NOTE (1): If XAMPP is installed in a base directory with spaces (e.g. c:\program filesC:\xampp) fakemail and mailtodisk do not work correctly.
; XAMPP IMPORTANT NOTE (2): In this case please copy the sendmail or mailtodisk folder in your root folder (e.g. C:\sendmail) and use this for sendmail_path.

; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the C:\xampp\mailoutput folder
; sendmail_path = "C:\xampp\mailtodisk\mailtodisk.exe"


In the log file, I find this:
mail() on [C:\xampp\htdocs\cpin\modules\mod_s5_quick_contact\tmpl\default.php:137]: To: myemail@mydomain.org -- Headers: From: Brian<xxxxx@gmail.com>


Any assistance would be greatly appreciated. Thanks.

Re: sendmail not working

PostPosted: 27. December 2012 18:36
by WilliL
Code: Select all
user myemail@mydomain.com

are you sure that's your gmail user name?

config for sendmail seams to be ok.
check from, user, password for spelling errors.

It could also be, that gmail denies relaying (to beware spams)

Re: sendmail not working

PostPosted: 27. December 2012 19:01
by brergo
That isn't my gmail...i changed it for this post for security reasons...

As far as Gmail denying relaying, I have it working on the one server with another gmail account.

Re: sendmail not working

PostPosted: 28. December 2012 11:02
by WilliL
did you tried the working gmail account with all parameters as hosted?
may be that relaying by xampp is classified in an other way then relaying by a hoster.

Re: sendmail not working

PostPosted: 29. December 2012 01:38
by brergo
Not sure what you mean, can you clarify?

WilliL wrote:did you tried the working gmail account with all parameters as hosted?
may be that relaying by xampp is classified in an other way then relaying by a hoster.

Re: sendmail not working

PostPosted: 01. January 2013 00:37
by brergo
Anyone?

Re: sendmail not working

PostPosted: 02. January 2013 19:30
by bprsk8r4272
this is what im using
php.ini
Code: Select all
[mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP = localhost
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = postmaster@localhost

; XAMPP IMPORTANT NOTE (1): If XAMPP is installed in a base directory with spaces (e.g. c:\program filesC:\xampp) fakemail and mailtodisk do not work correctly.
; XAMPP IMPORTANT NOTE (2): In this case please copy the sendmail or mailtodisk folder in your root folder (e.g. C:\sendmail) and use this for sendmail_path. 
 
; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the C:\xampp\mailoutput folder
;sendmail_path = "C:\xampp\mailtodisk\mailtodisk.exe"


then the 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"

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

# A freemail service example
account ********
tls on
tls_certcheck off
host smtp.gmail.com
from ***********@gmail.com
auth on
user **********@gmail.com
password *****************************

# Set a default account
account default : **********


i use the sendmail from xampp 1.7.3 and used it on versions 1.7.7 and 1.8.1

Re: sendmail not working

PostPosted: 07. January 2013 02:38
by brergo
Will try those settings tomorrow

Re: sendmail not working

PostPosted: 07. January 2013 12:11
by rajj
hello friend after 1 week of tension , it has been working thanx a lot friend :D :D :D 8) 8) 8) 8)