Sendmail : Connection closed gracefully - php

I am using wamp server on Windows with the sendmail program. I am trying to send an e-mail from my personal computer with my business email.
I configured the sendmail.ini
smtp_server=localhost
smtp_port=1055
default_domain=company.something
auth_username=mymail#company.something
auth_password= *****
I also changed the php.ini
SMTP = localhost
smtp_port = 1055
sendmail_path = "path\to\sendmail.exe"
And after reading others questions I used this trick
1º Right click on sendmail.exe
2º Properties
3º Compatibility
4º Change the configuration for all users
5º Execute as Windows XP SP 3
6º Execute as adminitrator
But still got the "Connection Closed Gracefully." error.
I am sure that my SMTP is correct because I use the same with Thunderbird and it run everyday since a year ago without any problem.
I am also sure that my configuration is well working because I tried to change the parameters to use a gmail account and it is working.
I just want to know, what this error mean ?

Related

Send mail from localhost

I want to know if it is possible to send emails from localhost. If yes, how? I want to send emails from my localhost using my gmail account. I have a Mac OS X Yosemite Version 10.10.1 and I am running XAMPP 5.6.3-0.
Thanks!
You can use PHP mailer and not configure SMTP on your machine or you can follow this instructions to configure sendmail with GMAIL.
I like option 2 :) (Just for fun). Of course the first option is easier.
First go to the path that you installed Xampp application. By default it is C:\xampp\.
Then we need to find the php.ini file which contains the
configurations belong to PHP. This file by default is located at
C:\xampp\php\php.ini. Open it using any text editor like notepad.
Using search in the editor try to find sendmail_path. There should
be two of them. One is commented using a ; (semicolon) in the
beginning of the line , and the other one is not commented. Comment
the one that is active and active the one is commented. After the
edit it should looks like below... (Similar)
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
; XAMPP: Comment out this if you want to work with mailToDisk,...
;sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"
Save the php.ini file and restart the Apache process. This is
necessary for the configuration to take place.
Next navigate to the sendmail directory. By default it should be
located at C:\xampp\sendmail and open the sendmail.ini in the
text editor.
Now we need to set the configuration for the mail server. For this
case I chose Gmail. The SMTP address of Gmail is: smtp.gmail.com
and the SMTP port for Gmail is 587.
Find smtp_server and write the Gmail SMTP address in front of
that.
Find smtp_port and write the Gmail SMTP port in front of that.
Scroll down , you should be able to see auth_username &
auth_password. Put your gmail username in front of auth_username
and put the password in front of auth_password .
Save and now you are good to send mail from local host.
Note that your PHP mail function should have "from" header,otherwise your mail will not go through.
Also remember the that the destination will receive the mail from your Gmail address not from the address you put in your PHP code.

DokuWiki on Windows wont send email

I set up DokuWiki on a Windows 2012 Server using wampserver
It works really well, but I can't get it to see any smtp server. I set up a local server using IIS, tested it using blat. I added the following lines to the php.ini:
SMTP = localhost
smtp_port = 25
sendmail_from address#host.com
I also tried using the computer's domain as the server, but Doku won't send any email. Looking at Doku's wiki, I found these helpful instructions: dokuwiki email, but I always get an error that says "Looks like there was an error on sending the password mail. Please contact the admin!"
I also tried the 'fake sendmail', but it gave me the same result.
I reset Apache and IIS after changing the configs, but there was no change. There is nothing in the log files either.
As far as I can tell, this should work. Is there another config file or something else that I missed?
Thanks,
Well, just pointing PHP to localhost for a mail server won't work unless you run a mailserver there.
You have three options:
configure your php.ini to point to a mail server on your LAN
run a local Mailserver (eg. http://www.pendriveapps.com/portable-smtp-server-mini-relay/)
use the swiftmail plugin (https://www.dokuwiki.org/plugin:swiftmail) to configure DokuWiki to use some other external mailserver (eg. gMail).

Configuring email in XAMPP

I made fresh installation of Windows Server 2003 and XAMPP. Installed Drupal 7 and the site is functioning properly. However, I am not able to send email. After searching I made the following configuration in php.ini and sendmail.ini.
Settings in php.ini
SMTP = mail.myserver.com
smtp_port = 25
sendmail_from = myid#myserver.com
Settings in sendmail.ini
smtp_server=mail.myserver.com
smtp_port=25
auth_username=myid#myserver.com
auth_password=mypassword
Note: We are using another machine (our own) for email server. That will be accessed as mail.myserver.com.
Problem:
I tested the service using php mail code and receiving the 'Success message'. But mail not delivered. The log file shows
authorization failed (#5.7.0)
but I used double checked my userid and password which is correct. I also changed the code in sendmail.ini
smtp_server=localhost
I received the error message "Socket Error # 10061Connection refused."
Kindly help to rectify the problem.
regards
Devan

WAMP & SendMail not working with GMAIL

I have scoured every tutorial out there on how to do this and I am still not getting the desired result so there must be some detail I am missing. The mail() function returns as though it succeeded however I NEVER GET ANY EMAILS in my sent or inbox
In a nutshell I have done the following:
Copied Sendmail.exe and Sendmail.ini along with their dlls to a
folder named Sendmail that resides in c:\program files\wamp\bin\
Edited the sendmail.ini to point to port 465 (for gmail) and smtp to
smtp.gmail.com, also configured the correct user name and password
authentication fields, as well as set smtp_ssl to ssl
Enabled the php_openssl and php_sockets under php extensions in wamp
edited php.ini [mail function] parameters. I commented out everything in win32 and then set smtp_path = c:\program files\wamp\bin\sendmail\sendmail.exe -t" then restarted all serviced on WAMP
Logged into my gmail account and enabled IMAP
Can anyone please help me out here???
This is from : http://blog.techwheels.net/send-email-from-localhost-wamp-server-using-sendmail/
I followed the steps and was able to send emails from wamp server. Your problem seems to be the name of the folder "Program Files" it has a space in it.
If the path to the sendmail.exe contains “space” (for example, “C:\Program Files\PHP\sendmail\”) then Apache would not be able to locate it. So, either store the sendmail.exe at a “non-spaced” location/path OR write the path in DOS style “C:\Progra~1\PHP\sendmail\” in the php.ini (sendmail_path = "C:\Progra~1\PHP\sendmail\sendmail.exe -t -i").
Have a look at > http://phpmailer.worxware.com/?pg=examplebgmail
and https://github.com/Synchro/PHPMailer
It's a lot easier and it saves a lot of time to send using frameworks rather than attempting to tinker wamp on your own.
(on a side note, it's MUCH easier to send gmail via smtp with python)
Good luck!

PHP mail() on Windows: no errors, the email isn't sent

I'm currently trying to debug an Elgg-based website (I didn't develop it) and I would like to send the emails directly from local development machine (WinXP). I'm running WAMP with Apache 2.2.11 and PHP 5.3.0
After some searching, the simplest solution that I've come across is using fake sendmail to forward it to my GMail/Google apps account via SMTP and let it do the sending. The problem is that I get no errors whatsoever, but the email isn't being sent.
Here's what I did:
Copied the sendmail.exe and sendmail.ini to a subfolder in WAMP
Configured it via sendmail.ini (the configuration settings are ok)
Edited php.ini to add the path to sendmail.exe
sendmail_path = "C:\Program Files\wamp\bin\sendmail\sendmail.exe -t"
Commented out the windows SMTP settings in php.ini
; SMTP = localhost
; smtp_port = 25
; sendmail_from = xxx#domain.com
; mail.force_extra_parameters =
The mail.log file shows the following:
mail() on [C:\Program Files\wamp\www\mail.php:9]: To: xxx --
Headers: From: xxx Reply-To: xxx X-Mailer: PHP/5.3.0
My guess is that the problem is that the default Windows option (to specify the server and not the sendmail utility) is not overriden. In phpinfo() I still get the SMTP -> localhost and smtp_port -> 25 options, even though I commented them.
If anyone managed to get this working, I'd really appreciate some help. In my opinion, using fake sendmail is a lot simpler than installing a mail server on your machine.
Thanks!
P.S. Please don't suggest PHPMailer and the like, because I have to use the mail() function. That's how Elgg works.
I've gotten it to work eventually. The problem was that PHP had a bug in parsing .ini files with spaces in the path (for sendmail). It was fixed in version 5.3.0, but the manual had no info on this.
So, yes, it is possible to use sendmail with PHP on Windows :D.
Thank you all for your time!
Make sure you have SMTP Service running on your local machine and that SMTP Port(25) is opened.
Have a check on the services (Run->services.msc) and look for Send Mail Transfer
If you cannot find SMTP on the services list, you must install it:
To add,
Run->appwiz.cpl->Add Remove Windows components->IIS->Details->SMTP
I am not sure if this helps or not, what i used to do in these scenarios was to setup , outlook on my machine and have it set to get emails from the pop every 5 mins or so, that way my ip/machine was authenticated against the pop and if i just set the :
SMTP = localhost
smtp_port = 25
in php.ini , the mail function worked fine. So in your case just set your outlook to work with a pop and use that smtp in php.ini and hopefully it should work. I havent tested this will GMail though.
P.S. Please don't suggest PHPMailer and the like, because I have to use the mail() function. That's how Elgg works.
...unless you're using a plugin that changes this behaviour:
http://community.elgg.org/pg/plugins/costelloc/read/16498/phpmailer

Categories