Configuring email in XAMPP - php

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

Related

Sendmail : Connection closed gracefully

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 ?

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).

PHP Mail error - Unable to send message to SMTP server. No recipients specified. ite. ready. in

I am trying to using a simple php email
This is working in my production server. But this is not working in my development server. I am not able to find what server configuration is missing
i am getting the error
Unable to send message to SMTP server. No recipients specified. ite. ready. in "filepath" on line 17
What is this ite?
$toemail="me#example.com";
$subject="subject line" ;
$content="conetent message";
$frmemail = "From:you#example.com" ;
mail( $toemail,$subject,$content,$frmemail ) ;
Can anyone suggest what configuration or php ini setting am missing
dev i access on a port .
i saw the exact same error here
http://www.phpfreaks.com/forums/index.php?topic=134654
http://forums.zend.com/viewtopic.php?t=5151&f=77#p23409
but what can be the some security settings blocking sending email from a different domain??
ZMAil
SMTP localhost
smtp_port 25
sendmail_from no value
The fourth parameter - additional headers - is optional. If is not set the sendmail_from option from php.ini will be used.
If you have access to the php.ini file, try to set the option to you#example.com and remove the 4th argument from mail() function.
Changing these settings on the server seems to have allowed the email to be sent successfully. The settings changed were:
AUTOADD(*YES)
ALWRLY(*ALL)
Allow rely mail is the main one

Warning: mail() [function.mail]: Failed to connect to mailserver

Getting error message
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in
Ive opened up php.ini and i believe i need to add
SMTP "localhost" PHP_INI_ALL
smtp_port "25" PHP_INI_ALL
sendmail_from NULL PHP_INI_ALL
sendmail_path NULL PHP_INI_SYSTEM
Im not sure where to add it though? Also correct me if anything i believe i need to do is incorrect. Im currently developing website on localhost so if anything i need to please tell me.
EDIT**
My local host is XAMPP amd i believe this has a mail server
You're probably not running an SMTP server on your localhost.
If you only need an SMTP server for development purposes, and you're running Windows, install smtp4dev, which can be found here: http://smtp4dev.codeplex.com/
It's a beautiful little piece of software that sits in your task bar and lets you see all email that is being sent to it. It doesn't actually send email anywhere, so you can work with live data without fear of spamming someone.
Then, when you want your application to actually send email (when you run it on the server), you will need an SMTP server address instead of "localhost". If you don't know which SMTP to use, speak to your network administrator or ISP.
Last but not least, if you access your email through an email program, you can probably find the "Outgoing server" in your settings somewhere, although that depends on which mail program you use. An "SMTP server" and an "Outgoing server" are exactly the same thing.
You can't send mail from your local computer if you don't have a mail server running on it. Just like everyone else has said: Make sure you have a mail server that is properly configured and up and running on your local computer, or install it on a remote computer and change the IP address/port to point to the remote computer.
You can add smtp configuration at any place, but it is a good idea to search for [mail function] section in that file and add that below. Also,
SMTP = *smtp server addr here*
smtp_port = 25
If you are not using XAMPP or some other packet of that kind, it's unlikely that you have smtp server up and running on localhost.
you have to install a Mail Server Program to your comp.. Localhost does not support send mail in default way

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