I have been unsuccessfully trying to send an email in PHP on XAMPP Lite version 1.7.3 on Windows since yesterday. However today after going through some other blogs and a little bit of my own research I was able to successfully send an email to my gmail account 🙂
Here are the steps I followed:
- Change in php.ini file. The file path is “C:\xampplite\php” (if your XAMPP Lite folder is in C drive).
- Search for sendmail_path in your php.ini file and remove the semi colon before it. Then set it to sendmail_path = “C:\xampplite\sendmail\sendmail.exe -t” (Make sure to test this path on your system first and correct it if necessary)
- Changes in sendmail.ini file. The file path is “C:\xampplite\sendmail” (if your XAMPP Lite folder is in C drive).
- Comment the “Mercury” and “A free mail service example” contents as shown below:
# 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 [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]
2. Add the account through which you want to send your mails. In my example I have configured the Gmail account as shown below:
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from [your_gmail_username]@gmail.com
auth on
user [your_gmail_username]@gmail.com
password [your_gmail_password]
3. Set the default account to Gmail as shown below:
account default : Gmail
- Now the required configuration changes have been done. We need to restart the Apache Server to reflect the changes in php.ini file.
- I have written a sample program below to check if mail is being sent.
<?php
$subject=”Hi There!!”;
$to=”<insert_receiver_mail_address>”;
$body=”This is my demo email sent using PHP on XAMPP Lite version 1.7.3″;
if (mail($to,$subject,$body))
echo “Mail sent successfully!”;
else
echo “Mail not sent!”;
?>
- On executing the above program I was able to successfully send a mail to any receiver address from PHP using XAMPP Lite 1.7.3 on Windows.
- Hope this blog helps you in case you have encountered a similar problem as I did. Please feel free to comment if this blog was useful to you.
#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 [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]
hi ive already set up my php.ini ang sendmail.ini but i still cant send an email.
here is the error i get
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 C:\xampplite\htdocs\testing.php on line 36
hi auie…could you paste your sendmail.ini file without your username and password? also could you paste some of the error messages in sendmail.log (in sendmail folder) and error.log (in apache/logs folder)? I was getting similar error earlier but after i made changes in sendmail.ini it worked fine for me.
Ive followed what you have post here.
this is my sendmail.ini
# Example for a user configuration file
# Set default values for all following accounts.
defaults
logfile “C:\xampplite\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 [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from *****@gmail.com
auth on
user *****@gmail.com
password ********
account default : Gmail
=========================================
there no log file in sendmail folder
hello.. gud day… i have tried changing my php.ini but i can’t save it because theirs an error message
is there anything that i should set in the xampp Control Panel?
my xampp version
XAMPP (Basis Package) version 1.7.3
my OS
Windows 7 ULTIMATE
please email me here my add awied16@yahoo.com
hey auie can u help me how to successfull to send mail from php.i got error lsame with u…
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 C:\xampplite\htdocs\testing.php on line 36.
can u help me…
my php info
===========================================================
sendmail_from no value no value
sendmail_path no value no value
Yey i was successful in sending email!
whooooooooooooooooooooooooooooha!
wow thts good news…..congrats to you!!
how did you change your ISP to SMPT? could you paste your codes? Badly.. need it for our project…
i didn’t change my php.ini or sendmail.ini i just use ini_set function and set my ISP as my SMTP
Could you detail me by email the ini_set()function you used? Would much appreciate that.
regards,
tom
how did you change your ISP to SMPT? could you paste your codes? Badly.. need it for our project…
I followed exactly like what you have posted but I can’t send out any mail to my hotmail account from google account… however no errors found and only “Mail sent successfully!” @_@
Please check if you have any error messages in your sendmail.log file or the error.log file (in apache/logs folder) and ensure that you have restarted your apache server after any changes to the php.ini file. Also could you paste the [mail function] settings from your php.ini file?
Hi,
i modified in order:
1) in php.ini i added this line, removing thi initial comment made by a ‘;’:
——————————————————–
sendmail_path = “\”C:\xampp\sendmail\sendmail.exe\” -t”
——————————————————–
2) After i opened the file sendmail.ini and i have commented all lines that there are as default, those reported to Mercury and Hotmail e i added those for gmail, and the end result is this:
——————————————————–
# 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 [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from bonomifederico89@gmail.com
auth on
user bonomifederico89@gmail.com
password ***************
# Set a default account
account default : Gmail
——————————————————–
I no more errors from php sending as troava of the configuration correct, the only file that is sendmail.log I discovered that he can not connect to smtp server google.
LOG——————————————-
Jul 02 09:03:19 host=smtp.gmail.com tls=on auth=on user=bonomifederico89@gmail.com from=bonomifederico89@gmail.com recipients=bonomifederico@hotmail.it errormsg=’cannot connect to smtp.gmail.com, port 25: Unknown error’ exitcode=EX_TEMPFAIL
———————————————-
See something wrong in what I do?
Thanks
Please make sure that you have restarted your apache server after making the required changes in the php.ini file. No need of the extra double quotes in the sendmail_path setting.
sendmail_path = “C:\xampp\sendmail\sendmail.exe\ -t”
Also could you paste your [mail function] settings from the php.ini file?
hi i hav tried all the steps like wat u said above..
im gettin as mail sent successfully in my browser screen..but then im not gettin the mail in the inbox..Can you pls help me wit this?
Thanxxxx a lot pallavi..im now able to send emails from my php script..
hello pallavi.
i have what you said above(php.ini,sendmail.ini and script).script runs successfully but not delivered.
and what do you mean by”Also could you paste your [mail function] settings from the php.ini file?”.i am not getting it
[…] thanks to Pallavi. His original post point me to the right direction. The only missing piece is port number in sendmail.ini where gmail […]
I also the same problem can you help me how did you resolve the problem
i hav tried all the steps like wat u said above..
im gettin as mail sent successfully in my browser screen..but then im not gettin the mail in the inbox..Can you pls help me wit this?
ma php ini settings are follows..
[mail function]
; For Win32 only.
SMTP =smtp.gmail.com
smtp_port = 25
; For Win32 only.
sendmail_from = chat2rithin@gmail.com
; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
sendmail_path = “C:\xampplite\sendmail\sendmail.exe\-t”
and sendmail ini is
# Set a default account
account default : Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from chat2rithin@gmail.com
auth on
user chat2rithin@gmail.com
password ************
hurrayyyyyyyyyyyyy..i got it…thanks pallavi… its wrknggggggggggggggg for me.. one more thing.. but i cant send html thngs why?
i got a something problem i didn’t know when sending email from localhost with php
finally, i found your tutorial and this tutorial works for me… 🙂
thanks Pallavi
if you don’t mind, may I share your tutorial in my blog, but in indonesian.. 😀
hola a toos
hola a todos
hola que tal a toos
hola que tal a todos
Thanks a lot. Browsed through a lot of sites. some even said it was not possible. But your method worked .
Thanks for this!!!! Works great!!
Hy please help me . I get this in the error.log
sendmail.exe: cannot connect to smtp.gmail.com, port 25: Connection timed out
sendmail.exe: could not send mail (account default from C:\xampplite\sendmail\sendmail.ini)
Hi Pallavi,
Thanks for the excellent post.
I too was having difficulties with this problem and did everything you described in the post. I get a reply from the PHP script saying “Message sent successfully” but I don’t actually see the mail in my inbox. Could you suggest a reason?
Here are my configuration details:
# Example for a user configuration file
# Set default values for all following accounts.
#defaults
logfile “C:\xampplite\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 [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]
# Set a default account
account default : Gmail
account Gmail
tis on
tis_certcheck off
host smtp.gmail.com
from tom.dr.mathew@gmail.com
auth on
user tom.dr.mathew@gmail.com
password ********
Hi Pallavi,
After 2 weeks on my hard work, got your post.Feel good to see your post.
Can you please help me too. I follow your steps and getting “Message successfully sent” but no email in my gmail account.
Please help me too.
My Info: –
Windows Vista
XAMPP for windows
Netbeans with PHP
php.ini : –
[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”
sendmail.ini : –
# 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 [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from abc.abc@gmail.com
auth on
user abc.abc@gmail.com
password *********
# Set a default account
account default : Gmail
What’s the next step to do?
Hi Puja. Next step is to restart your web server and write a sample program to check if the mail is being sent to you.If the mail is not sent then you will have to check the log files. Try changing the smtp port to 587.
Thanks a lot.I tried sending mails for 2 days but i didnt get .After following your steps i have successfully sent mails
Hey, how to u get to sendemail using php? mind to guide me? i have follow all the step. i can get the “message sent” but cant receive it in my mail box
I have a hard time solving this, my php.ini file looks like this
[mail function]
sendmail_path = “C:\xampp\sendmail\sendmail.exe -t”
and my sendmail.ini looks like
# Example for a user configuration file
defaults
logfile “C:\xampp\sendmail\sendmail.log”
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from diegofon@gmail.com
auth on
user diegofon@gmail.com
password ************
account default : Gmail
What am I doing wrong??
Hi Diego…I don’t see anything wrong in your settings. Hope you restarted the web server before sending test mail.Check in the log/error files for messages.
I set my php ini file well, but had to change my folder permission to 777 and also restarted xampp
Thank you.
I’ve been trying to find a solution to this for ages.
I’ve had to keep uploading changes to a ‘live’ server to test forms.
Thanks for sharing
@webecho
Hello,
I have tried doing what you said and changed all the relevant parts of sendmail.ini and php.ini
in Sendmail.ini
# 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 avlabtechnion@gmail.com
auth on
user avlabtechnion@gmail.com
password *********
# Set a default account
account default : Gmai
and in php.ini: I changed the mail function section as follows:
[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP = http://gmail.google.com
; http://php.net/smtp-port
;smtp_port = 25
SMTP = smtp.gmail.com
smtp_port = 465
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = avlabtechnion@gmail.com
; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
; http://php.net/sendmail-path
sendmail_path = “\”C:/Documents and Settings/avlab/My Documents/Noa/AVL-Website/XAMPPLite/xampplite/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:\Documents and Settings\avlab\My Documents\Noa\AVL-Website\XAMPPLite\xampplite\apache\logs\php_mail.log”
Hello,
I have tried doing what you said and changed all the relevant parts of sendmail.ini and php.ini
in Sendmail.ini
# 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 avlabtechnion@gmail.com
auth on
user avlabtechnion@gmail.com
password *********
# Set a default account
account default : Gmai
and in php.ini: I changed the mail function section as follows:
[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP = http://gmail.google.com
; http://php.net/smtp-port
;smtp_port = 25
SMTP = smtp.gmail.com
smtp_port = 465
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = avlabtechnion@gmail.com
; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
; http://php.net/sendmail-path
sendmail_path = “\”C:/Documents and Settings/avlab/My Documents/Noa/AVL-Website/XAMPPLite/xampplite/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:\Documents and Settings\avlab\My Documents\Noa\AVL-Website\XAMPPLite\xampplite\apache\logs\php_mail.log”
Oops, I forgot to state the problem. so, as I said, I updated php.ini and sendmail.ini as I posted above. still, when I try mailing using php’s mail() command I keep getting the error “could not send mail” – and nothing more than that.
when I open sendmail.log I see the error:
Feb 06 15:12:39 host=smtp.gmail.com tls=on auth=on user=avlabtechnion@gmail.com from=avlabtechnion@gmail.com recipients=nkushnir@gmail.com errormsg=’cannot connect to smtp.gmail.com, port 25: Unknown error’ exitcode=EX_TEMPFAIL
I am going crazy because I specified port 465 in php.ini.
What am I doing wrong?
Hi Noa….You seem to be missing the last letter ‘l’ in the default account setting of Gmail in your sendmail.ini file. In the php.ini file the SMTP value is set to localhost and not smtp.gmail.com. Try to use port number 587 and make sure to restart your web server before you execute your test program.
Hello,
I have followed the instruction above and I get the message: ‘Mail sent successfully’ but no mail is sent. from the log file it seems that it does not connect to gmail.
****my php.ini file looks like this:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 587
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = danielcucos@gmail.com
; 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”
****sendmail.ini looks like this:
# 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 [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from ********@gmail.com
auth on
user ********@gmail.com
password ********
# Set a default account
account default : Gmail
****the test.php file looks like this:
**** sendmail.log file is:
Feb 14 23:08:30 host=smtp.gmail.com tls=on auth=on user=*****@gmail.com from=******@gmail.com recipients=*******@yahoo.com errormsg=’cannot connect to smtp.gmail.com, port 25: Connection refused’ exitcode=EX_TEMPFAIL
I am restartin the localhost everytime I make a change.
I cannot see what I am doing wrong…please help!
Hi Daniel….in the php.ini file set the SMTP to localhost restart the APACHE server and try sending the mail. If this also doesn’t work out then change the smtp_port number to 25, restart the APACHE server and try sending the mail.
Hi Pallavi,
Thank you for your reply. I have found what the problem was and solved.
I am on my University’s network and the ports were blocked and that is why I could not connect. The tutorial is great and it works.
Thank you for all your help. big thumbs up 🙂
Hi, I noticed For “Win32 only.”
Will this work for Win64?
Thank you.
Also, how long does it take for the mail to arrive?.
not sure as I have not tested it. the email should arrive straight away. there should be no wait at all.
Hello there Pallavi,
I floowed your post, but I still can’t send messages in gmail.
Could you help me please..
Is there something wrong with my settings?
[sendmail]
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from judge.kyo15@gmail.com
auth on
user ***********@gmail.com
password *********
port 465
account default : Gmail
SMTP = smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 465
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = judge.kyo15@gmail.com
;sendmail_path = “C:\xampp\sendmail\sendmail.exe\ -t”
note: I used port: 465 because someone told me that this is googles port and i’m unaware of that…
Thanks Pallavi and more POWER!!
Hi Dan….sorry for the late reply…hope your problem has been solved…if not you can try using port number 587..In my case it worked without changing the port number.
Hi pallavi,
I am facing same prblm….i try port no 587 as well as 25..even restart my sever..no success..no error message in log file. What should i do? Please reply
Hi Shikha its difficult to debug a program without error messages. Please ensure that error_log in php.ini is not commented. Also check for apache server errors in apache log files folder.
I tried to edit the php.ini and made the changes…and emails successfully sent but did not receive the emails. any ideas? all I did is to edit the php.ini, I didnt touch the mercury mail. Please help on this, I have been looking for this eversince. Any ideas will do…Thank you…
how does your sendmail.ini look like? you may need to configure your mail account in there.
hi, you have given the email configurations for Xampplite 1.7.3, but xampplite 1.7.1 does not have such lines in the sendmail.ini file, could you tell me how to add that ??
Thanks
Ronald @ Ronea
Hi
THANX
SO SMART
PALLAVVVVVVVVVVV
Hello there Pallavi,
I floowed your post(restart apache after any changing,changed port to 587 and 25), I can send messages successfully but can’t receive the email. Could you help me please..
Following is the error.log …
[Tue May 24 21:27:02 2011] [notice] Parent: Received shutdown signal — Shutting down the server.
[Tue May 24 21:27:02 2011] [notice] Child 1112: Exit event signaled. Child process is ending.
[Tue May 24 21:27:03 2011] [notice] Child 1112: Released the start mutex
[Tue May 24 21:27:04 2011] [notice] Child 1112: All worker threads have exited.
[Tue May 24 21:27:04 2011] [notice] Child 1112: Child process is exiting
[Tue May 24 21:27:04 2011] [notice] Parent: Child process exited successfully.
[Tue May 24 21:27:09 2011] [notice] Digest: generating secret for digest authentication …
[Tue May 24 21:27:09 2011] [notice] Digest: done
[Tue May 24 21:27:10 2011] [notice] Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 configured — resuming normal operations
[Tue May 24 21:27:10 2011] [notice] Server built: Nov 11 2009 14:29:03
[Tue May 24 21:27:10 2011] [notice] Parent: Created child process 1348
[Tue May 24 21:27:13 2011] [notice] Digest: generating secret for digest authentication …
[Tue May 24 21:27:13 2011] [notice] Digest: done
[Tue May 24 21:27:13 2011] [notice] Child 1348: Child process is running
[Tue May 24 21:27:13 2011] [notice] Child 1348: Acquired the start mutex.
[Tue May 24 21:27:13 2011] [notice] Child 1348: Starting 150 worker threads.
[Tue May 24 21:27:13 2011] [notice] Child 1348: Starting thread to listen on port 443.
[Tue May 24 21:27:13 2011] [notice] Child 1348: Starting thread to listen on port 80.
[Tue May 24 21:27:13 2011] [notice] Child 1348: Starting thread to listen on port 443.
[Tue May 24 21:27:13 2011] [notice] Child 1348: Starting thread to listen on port 80.
sendmail.exe: cannot connect to smtp.gmail.com, port 25: Connection timed out
sendmail.exe: could not send mail (account default from C:\xampp\sendmail\sendmail.ini)
php.ini [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 = tsuzuki.cs@gmail.com
sendmail.ini
# 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 [your_username]@hotmail.com
#auth on
#user [you_username]@hotmail.com
#password [your_password]
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from gavin333@gmail.com
auth on
user gavin333@gmail.com
password **********
# Set a default account
account default : Gmail
the correct php.ini
php.ini [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 = gavin333@gmail.com
; 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”
Hi Gavin…the error log says “sendmail.exe: cannot connect to smtp.gmail.com, port 25: Connection timed out” which means that sendmail is not able to connect to the smtp server.This could be due to firewall/antivirus restrictions or issue with ssl connections. For ssl issue please check if you have libeay32.dll and ssleay32.dll files in the sendmail folder.
I am literally confused with the format u gave in the beginning and then agreeing to the ones given by people above.
No. of ways to deal with SMTP =
( either localhost or smtp.gmail.com…..so total 2)
No. of ways to deal with smtp_server =
(25, 465, 587…total 3)
So we get 2×3=6 ways +1 for putting semicolon before both of them..hence total 7.
No. of ways to fill sendmail_from =
(2 i.e. putting semicolon or not)
So total ways to modify php.ini file=7×2=14…Considering sendmail_path = “C:\xampp\sendmail\sendmail.exe -t” is the correct way.
Then in the sendmail.ini file either do we have to mention port or not..if yes then again thr r 3 ways(25,465,587)….so total 4 ways to modify sendmail.ini file.
Hence altogether it becomes 14×4=56 ways to complete the overall task…..looks like a joke but that was what i cud infer from the above discussion..that pple came with some or the other way among those 56….i don’t how many i have tried but didn’t get positive result in any of them…when i use 465 or 587 error gives unknwn port….etc….and with 25 it gives…server sent empty reply…
CAN smbdy give an explicit soln to the above taking care of all the areas i mentioned…thnx fr reading..
Hi Pallavi,
I followed exactly what u written above, i got email sent but i cant receive the email. These are my coding
SendMail.ini
# 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 [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from my@gmail.com
auth on
user my@gmail.com
password *******
# Set a default account
account default : Gmail
php.ini
[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 = my@gmail.com
; 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”
can u guide me how?
Hey, how to u get to sendemail using php? mind to guide me? i have follow all the step. i can get the “message sent” but cant receive it in my mail box
my sendmail.ini is different.need help plzz
; 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=smtp.gmail.com
; smtp port (normally 25)
smtp_port=587
; 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=luvbeggrz@gmail.com
auth_password=
; 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
hasnat,
You need to provide your Gmail password
message sent but i couldnt see the email in the email i sent it to
Check for any error messages in the error log file.
I’d like to add something here that may help those who are seeing errors about being unable to connect on port 25 and using smtp.gmail.com
In the php.ini, set:
smtp_port = 587
Got that. Good.
Now, sendmail.ini has a little known and little used “port” parameter. I used this and put it right under the “host” parameter. It looks like this:
host smtp.gmail.com
port 587
Make the change, save sendmail.ini, restart the web server and test. At this point, I was successfully receiving email on Gmail through XAMPP!
Good luck!
I m getting error
errormsg=’cannot locate host smtp.gmail.com: No such host is known. ‘ exitcode=EX_NOHOST
try pinging smtp.gmail.com and if it fails then you may have to change your port number
i’ m also get mail sent successfully in my browser , but i also not get the mail in the inbox. Can help me solve this problem?
In php.ini:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 587
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = fashiondeisgn@gmail.com
; 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 sendmail.ini:
# 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 [exampleuser]@hotmail.com
auth on
user [exampleuser]@hotmail.com
password [examplepassword]
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from fashiondeisgn@gmail.com
auth on
user fashiondeisgn@gmail.com
password **********
# Set a default account
account default : Gmail
i’m also get mail sent successfully in my browser, but not get the mail in the inbox. Can help me solve this problem?
in php.ini:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 587
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = fashiondeisgn@gmail.com
; 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 sendmail.ini:
# 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 [exampleuser]@hotmail.com
auth on
user [exampleuser]@hotmail.com
password [examplepassword]
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from fashiondeisgn@gmail.com
auth on
user fashiondeisgn@gmail.com
password ***************
# Set a default account
account default : Gmail
for sendmail.log:
Nov 23 14:12:48 host=smtp.gmail.com tls=on auth=on user=fashiondeisgn@gmail.com from=fashiondeisgn@gmail.com recipients=fashiondeisgn@gmail.com errormsg=’network read error: Connection reset by peer’ exitcode=EX_IOERR
As per the log there doesn’t seem to be any error in the script….there seems to be a network issue causing this error….
sorry, i am very late reply to you.I I also already change the network, the php.ini and sendmial.ini are same thing above, but also got error.
in sendmail.log :
Nov 29 12:33:34 host=smtp.gmail.com tls=on auth=on user=fashiondeisgn@gmail.com from=fashiondeisgn@gmail.com recipients=fashiondeisgn@gmail.com errormsg=’cannot connect to smtp.gmail.com, port 25: Connection timed out’ exitcode=EX_TEMPFAIL
the error shows that it is not able to connect to smtp.gmail.com on port 25 so try changing the port number to 25 and try again….
message sent but not received in inbox. can you help me, please?
i did use my real account and password where needed.
[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=smtp.gmail.com
; smtp port (normally 25)
smtp_port=587
; 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=gmail.com
; 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=*********
auth_password=**********
; 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
From php.ini:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 587
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = *****************
; 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”
also used port 465
what error are you getting in your error log file?
succes but not receive >.<
no error T_T.
——————————————————————————————
php.ini
[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 = *************@gmail.com
; 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\php\logs\php_mail.log"
——————————————————————————————
sendmail.ini
defaults
logfile "C:\xampp\sendmail\sendmail.log"
# SMTP Gmail
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from ***********@gmail.com
auth on
user ***********@gmail.com
password *************
account default : Gmail
——————————————————————————————php test
<?php
$from_name = "Energeiz";
$from_email = "***********@gmail.com";
$headers = "From: $from_name “;
$body = “Hi, \nThis is a test mail from $from_name .”;
$subject = “Test mail from Energeiz”;
$to = “************@yahoo.co.uk”;
if (mail($to, $subject, $body, $headers)) {
echo “success!”;
} else {
echo “fail…”;
}
?>
what should i do next?
thanks
Hi Energeiz in the sendmail_path in php.ini file there has to be a space between sendmail.exe and -t. After you add this space restart the server and then execute your program and your mail will be sent successfully.
Hi, Pallavi.
Still not received >.<
i use xampp 1.7.7.
there is something must set beside php.ini and sendmail.ini?
thanks before.
Hi, Pallavi.
Still not received >.<
i use xampp 1.7.7.
there is something must set beside php.ini and sendmail.ini?
thanks.
Hi Energeiz….check if you have any error messages in the log files to get some clue about the problem. hope you are able to solve it.
Summerinaskinalk
Brilliant, works a treat! Thank you!
Hi Pallavi..
mail is not coming.. In browser it is showing success messages…
Plz help me ASAP………….
No errors in log file…..
I modified like this..
***********php.ini
[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 =
; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
; http://php.net/sendmail-path
sendmail_path = “C:\xampplite\sendmail\sendmail.exe -t”
*********sendmail.ini
# Example for a user configuration file
# Set default values for all following accounts.
defaults
logfile “\xampplite\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 [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]
# Set a default account
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from prudhvikumar07@gmail.com
auth on
user prudhvikumar07@gmail.com
password ************
account default : Gmail
mail.php
mail.php
mail.php
mail_log…………………………
mail() on [C:\xampplite\htdocs\mail.php:9]: To: prudhvikumar07@gmail.com — Headers:
mail() on [C:\xampplite\htdocs\mail.php:9]: To: prudhvikumar07@gmail.com — Headers:
mail() on [C:\xampplite\htdocs\mail.php:5]: To: prudhvikumar07@gmail.com — Headers:
mail() on [C:\xampplite\htdocs\mail.php:5]: To: prudhvikumar07@gmail.com — Headers:
mail() on [C:\xampplite\htdocs\mail.php:5]: To: prudhvikumar07@gmail.com — Headers:
mail() on [C:\xampplite\htdocs\mail.php:5]: To: prudhvikumar07@gmail.com — Headers:
error.log
sendmail.exe: cannot connect to smtp.gmail.com, port 25: Network is unreachable
sendmail.exe: could not send mail (account default from C:\xampplite\sendmail\sendmail.ini)
I successfully get the message sent.but did not receive in my inbox. below is my php.ini file
; 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 = syarmil@gmail.com
; 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”
can someoone help me?
http://www.sotsialnye-seti.ru/index/odnoklassniki/0-4 вопросы и жалобы на сайте одноклассники.ру
http://www.recept-prigotovleniya.ru/ найти рецепт приготовления цыпленок табака
Please help me, i got this error in my apache log file. then i couldnt get the email in inbox….
sendmail: Error during delivery: Socket Error # 10061
Connection refused.
Hi Pallavi
Great Post .The steps are very clear .I am able to send the message but not recieving it in my gmail inbox.
I have tried setting the port at 567 or 485 or 25 .all work the same .no email recived ..also i have tried starting the apache after every change yet no results .Kindly help ..
sendmail.ini
———————–
# 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 [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]
# Example for a user configuration file
defaults
logfile “C:\xampp\sendmail\sendmail.log”
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from jayshreekrishnan@gmail.com
auth on
user jayshreekrishnan@gmail.com
password ***
account default : Gmail
php.ini
—————————–
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = jayshreekrishnan@gmail.com
; 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”
Kindly help
Thanks
Jayshree
Hey Jayshree….there could be an issue with your port connection….you need to check your log files to see the error message/s therein to find a clue to your problem…
hi pallavi,
i dont have C:\xampp\sendmail\sendmail.log file then how can i edit and send the email. please help me the needful..
Hi Ruban….the sendmail.ini file in sendmail folder contains the name and path of the sendmail.log file….u need to check if it is commented and uncomment it if so, so that logs are maintained for tracking errors
hi pallavi can u pls help me. i am creating a registration form with activation link . beginner in php . i am using XAMPP version 1.7.7
i got successful mgs .but i didnt get any mail. could u pls help me.
here my code,
php.ini
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 465
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = rts.itteam@gmail.com
; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
; http://php.net/sendmail-path
sendmail_path = “C:\xampplite\sendmail\sendmail.exe -t”
sendmail.ini
[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=smtp.gmail.com
;smtp port (normally 25)
smtp_port=465
smtp_ssl=auto
default_domain=gmail.com
auth_username=rts.itteam@gmail.com
auth_password=******
register.php
<?php
require 'include/connect.php';
session_start();
if(isSet($_POST['submit']))
{
$err = array();
if(strlen($_POST['username'])32)
{
$err[]=’* Your username must be between 3 and 32 characters!’;
}
if(preg_match(‘/[^a-z0-9\-\_\.]+/i’,$_POST[‘username’]))
{
$err[]=’* Your username contains invalid characters!’;
}
if(!preg_match(“/^[\.A-z0-9_\-\+]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/”,$_POST[’email’]))
{
$err[]=’ * Your email is not valid!’;
}
if(!count($err))
{
$email = mysql_real_escape_string($_POST[’email’]);
$username = mysql_real_escape_string($_POST[‘username’]);
$pass = substr(md5($_SERVER[‘REMOTE_ADDR’].microtime().rand(1,100000)),0,6);
$insert = mysql_query(“INSERT INTO tut_users(usr,pass,email,ip,dt)
VALUES(
‘”.$username.”‘,
‘”.md5($pass).”‘,
‘”.$email.”‘,
‘”.$_SERVER[‘REMOTE_ADDR’].”‘,
NOW()
)”);
if($insert)
{
$from=”noreply@tutorialpot.com”;
$to=$_POST[’email’];
$subject = “Tutorialpot | login form demo”;
$headers = “From: “.$from.”\r\n”;
$headers = “Reply-To: “.$from.”\r\n”;
$headers = ‘Content-type: text/html; charset=iso-8859-1’ . “\r\n”;
$headers .= “X-Mailer: PHP \r\n”;
$msg =
“You or someone using your email ” .$email. ” signed up on yourwebsite.com
Password: ” .$pass. ”
“;
@mail($email, $subject, $msg, $headers);
//$from_add = “noreply@fnhmagazines.com.com”;
//$to_add = “$email”; //<– put your yahoo/gmail email address here
//$subject = "Test Subject";
//$message = "Test Message";
//$headers = "From: $from_add \r\n";
//$headers .= "Reply-To: $from_add \r\n";
//$headers .= "Return-Path: $from_add\r\n";
//if(mail($to_add,$subject,$message,$headers))
//{
//$msg = "Mail sent OK";
//}
//else
//{
// $msg = "Error sending email!";
//}
$_SESSION['success']='Registration successfull Please check your inbox or spam!';
}
else $err[]='This username / email is already taken!';
}
if(count($err))
{
$_SESSION['err'] = implode('’,$err);
}
header(“Location: register.php”);
exit;
}
?>
SUBSCRITION
Subscription on fnhmagazines.com account!
Already a member? Login here!
<?php
if(isset($_SESSION['err']))
{
echo '’.$_SESSION[‘err’].”;
unset($_SESSION[‘err’]);
}
if(isset($_SESSION[‘success’]))
{
echo ”.$_SESSION[‘success’].”;
unset($_SESSION[‘success’]);
}
?>
Username
Email
A password will be emailed to you
apache error.log
[Sat Jun 16 17:51:41 2012] [notice] Parent: Received shutdown signal — Shutting down the server.
[Sat Jun 16 17:51:41 2012] [notice] Child 2408: Exit event signaled. Child process is ending.
[Sat Jun 16 17:51:42 2012] [notice] Child 2408: Released the start mutex
[Sat Jun 16 17:51:43 2012] [notice] Child 2408: All worker threads have exited.
[Sat Jun 16 17:51:43 2012] [notice] Child 2408: Child process is exiting
[Sat Jun 16 17:51:45 2012] [notice] Parent: Child process exited successfully.
[Sat Jun 16 17:52:22 2012] [notice] Digest: generating secret for digest authentication …
[Sat Jun 16 17:52:22 2012] [notice] Digest: done
[Sat Jun 16 17:52:26 2012] [notice] Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 configured — resuming normal operations
[Sat Jun 16 17:52:26 2012] [notice] Server built: Sep 10 2011 11:34:11
[Sat Jun 16 17:52:26 2012] [notice] Parent: Created child process 1600
[Sat Jun 16 17:52:28 2012] [notice] Digest: generating secret for digest authentication …
[Sat Jun 16 17:52:28 2012] [notice] Digest: done
[Sat Jun 16 17:52:30 2012] [notice] Child 1600: Child process is running
[Sat Jun 16 17:52:30 2012] [notice] Child 1600: Acquired the start mutex.
[Sat Jun 16 17:52:30 2012] [notice] Child 1600: Starting 150 worker threads.
[Sat Jun 16 17:52:30 2012] [notice] Child 1600: Starting thread to listen on port 80.
[Sat Jun 16 17:52:30 2012] [notice] Child 1600: Starting thread to listen on port 443.
The filename, directory name, or volume label syntax is incorrect.
need your help
Hi Priya you need to check for error message in sendmail.log file in the sendmail folder…this will give you the specific error message related to sending the mail…..
Hi pallavi, thanx for ur reply.. but is no sendmail.log file in the sendmail folder
Priya your sendmail.ini file will contain the filename and path of the logfile…you need to uncomment it (if it is commented) to enable logging sendmail errors/messages.
hi pallavi, i did as what you said above but still there is no error log file.
; 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=smtp.gmail.com
;smtp port (normally 25)
smtp_port=465
; 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=gmail.com
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=rts.itteam@gmail.com
auth_password=*******
; 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=
; 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
Priya….what you have pasted here is from php.ini file….i’m talking about the sendmail.ini file in the sendmail folder….there should be a line like this in sendmail.ini file
defaults
logfile “C:\xampplite\sendmail\sendmail.log”
this will log sendmail errors/messages! if its not present then you will need to add it and then restart the server and execute your program…
hi pallavi..
i did al dis above config in php.ini & sendmail.ini
it shows mail sent …but not yet received..
im using xampp 1.7.4
by default the sendmail,ini differs the above 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=localhost
; 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=
;auth_password=
; 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
i did like above in sendmail.ini…nt at all receives…
i did like dis..
[sendmail]
# Example for a user configuration file defaults
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from *****@gmail.com
auth on
user ******@gmail.com
password ********
account default : Gmail
help me to solve dis prblm…
dis error shows for me….
12-07-17 15:15:53 : Must issue a STARTTLS command first. pe8sm13725667pbc.76
12-07-17 15:17:50 : Must issue a STARTTLS command first. nh8sm13732783pbc.60
i got this error so can u help me..please…as soon as possible.this is for my project where i need to present next week..please send to my email if any solution n_dayah01@yahoo.com thanks you
Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. kh1sm2245836pbc.23 in C:\xampplite\htdocs\psm\1.php on line 14
Failure
Can anyone help me??
As said here I modified both php.ini and sendmail files. But still i cant send mail..
It is saying like follows..
Warning: mail() [function.mail]: SMTP server response: 553 sorry, relaying denied from your location [117.215.209.103] (#5.7.1) in C:\xampp\htdocs\vicky\vmail.php on line 5
Mail not sent!
This piece of writing provides clear idea for the new viewers of blogging, that really how to do blogging.
Very soon this website will be famous amid all blogging and site-building people, due to it’s good articles
my sendmail is different :-
; 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=mail.mydomain.com
; 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=mydomain.com
; 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=
auth_password=
; 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=
; 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=
[Mon Nov 12 13:53:57 2012] [notice] Child 3624: Child process is running
[Mon Nov 12 13:53:57 2012] [notice] Child 3624: Acquired the start mutex.
[Mon Nov 12 13:53:57 2012] [notice] Child 3624: Starting 150 worker threads.
[Mon Nov 12 13:53:57 2012] [notice] Child 3624: Starting thread to listen on port 443.
[Mon Nov 12 13:53:57 2012] [notice] Child 3624: Starting thread to listen on port 80.
[Mon Nov 12 13:53:57 2012] [notice] Child 3624: Starting thread to listen on port 443.
[Mon Nov 12 13:53:57 2012] [notice] Child 3624: Starting thread to listen on port 80.
‘C:\sendmail\sendmail.exe\’ is not recognized as an internal or external command,
operable program or batch file.
The Message is successful but no email send to me
I did it too! I’ve been trying to figure this out for a day already. Thank you so much!
Fantastic post however , I was wanting to know if you could write
a litte more on this topic? I’d be very grateful if you could elaborate a little bit more. Appreciate it!
Hi, I do believe this is an excellent web site. I
stumbledupon it 😉 I will revisit yet again since i have book-marked it.
Money and freedom is the best way to change, may you be rich and
continue to guide others.
Plz solve this problem and send me replay
Warning: mail() [function.mail]: “sendmail_from” not set in php.ini or custom “From:” header missing in D:\xampp\htdocs\adminssion\admsn – Copy\insert_enquiry.php on line 34
Warning: mail() [function.mail]: “sendmail_from” not set in php.ini or custom “From:” header missing in D:\xampp\htdocs\adminssion\admsn – Copy\insert_enquiry.php on line 35
Warning: mail() [function.mail]: “sendmail_from” not set in php.ini or custom “From:” header missing in D:\xampp\htdocs\adminssion\admsn – Copy\insert_enquiry.php on line 36
I’m new to xampp..
I want to ask; where we should put this code;
# 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 [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from [your_gmail_username]@gmail.com
auth on
user [your_gmail_username]@gmail.com
password [your_gmail_password]
account default : Gmail
If you would like to take a great deal from this paragraph then you have
to apply these strategies to your won webpage.
I do not have these on my sendmail.ini
# 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 [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]
It’s actually a nice and helpful piece of info. I’m happy that you simply shared
this useful info with us. Please keep us up to date like this.
Thank you for sharing.
My brother recommended I would possibly like this blog.
He was once entirely right. This put up actually
made my day. You cann’t imagine just how so much time I had spent for this information! Thanks!
I’m not that much of a online reader to be honest but
your blogs really nice, keep it up! I’ll go ahead and bookmark your site to come back in the future. Many thanks
Hello my family member! I want to say that this post is amazing, great written and come with approximately all vital infos.
I would like to see extra posts like this .
If some one wishes to be updated with most up-to-date technologies afterward he must be
visit this website and be up to date all the time.
in my system not working the mail() function.i saw your post and change my php.ini file and sendmail.ini file but a warning message is occurred that message is mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. wr9sm2172546pbc.7 – gsmtp .plz help me give me a solution……
It’s very simple to find out any topic on net as compared to textbooks, as I found this piece of writing at this site.
Because the admin of this site is working, no
uncertainty very rapidly it will be famous, due to its quality contents.
hey ,
could you please help me fix this issue.
i tried configuring the php and mailsender files
no help
When i change the port number it just loads until it times out and nothing happens
the port number 587 for gmail account gives this error. and 465 doesnt work.
Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. p5sm10877585igj.10 – gsmtp in C:\xampp\htdocs\php\register.php on line 54
I have read so many content regarding the blogger lovers except this piece of writing is really a good paragraph, keep it
up.
Shrinkage – The issue of penile shrinkage related to marijuana use is debatable.
The market still remains largely underpenetrated and offer huge growth
potential. For most of us, taking a bath is just a regular
daily activity that we do in order to keep our bodies clean and hygienic.
If you wish for to take a great deal from this paragraph then you have to apply these techniques to your won weblog.
If some one wishes expert view on the topic of blogging then i propose him/her
to pay a quick visit this webpage, Keep up the fastidious job.
Fastidious respond in return of this issue with genuine
arguments and telling everything on the topic of that.
Pretty! This has been an incredibly wonderful article.
Thank you for providing this information.
I will right away grab your rss feed as I
can’t find your email subscription hyperlink or newsletter service.
Do you have any? Please permit me realize
so that I could subscribe. Thanks.
I have learn some good stuff here. Certainly value bookmarking for revisiting.
I wonder how a lot attempt you place to create one of these magnificent informative web site.
Hello there! I know this is kinda off topic nevertheless I’d figured I’d ask.
Would you be interested in exchanging links or maybe guest writing a blog post or vice-versa?
My blog discusses a lot of the same subjects as yours and I believe we could greatly benefit from each other.
If you might be interested feel free to shoot me an email.
I look forward to hearing from you! Great blog by the
way!
My brother suggested I might like this website.
He was totally right. This post truly made my day.
You can not imagine just how much time I had spent for this info!
Thanks!
If some one needs to be updated with newest technologies after that he
must be pay a visit this website and be up
to date everyday.
I think this is one of the most significant information for me.
And i am glad reading your article. But should remark on few general things, The web site style is great,
the articles is really great : D. Good job, cheers
great issues altogether, you just received
a emblem new reader. What may you recommend in regards to
your post that you just made a few days in the past? Any positive?
I read this piece of writing completely concerning the difference of newest and earlier technologies, it’s amazing article.
I know this site offers quality based posts and other
data, is there any other web page which presents
such stuff in quality?
Hmm is anyone else encountering problems with the images on this blog loading?
I’m trying to determine if its a problem on my end or if it’s the blog.
Any responses would be greatly appreciated.
This site was… how do you say it? Relevant!! Finally I
have found something that helped me. Cheers!
My spouse and I stumbled over here by a different website and thought I might as well check things
out. I like what I see so i am just following you. Look forward to exploring your web page for a second time.
Do you mind if I quote a few of your posts as long
as I provide credit and sources back to your website?
My blog is in the exact same niche as yours and my
users would certainly benefit from a lot of the information you
present here. Please let me know if this okay with you. Appreciate it!
Greetings from Idaho! I’m bored to death at work so I decided to check
out your blog on my iphone during lunch break. I really
like the info you provide here and can’t wait to
take a look when I get home. I’m shocked at how quick your blog
loaded on my phone .. I’m not even using WIFI,
just 3G .. Anyhow, great blog!
I’d like to thank you for the efforts you have put in writing this blog.
I really hope to see the same high-grade blog posts from you later on as well.
In fact, your creative writing abilities has inspired me to get my own blog now ;
)
After looking at a handful of the blog articles on your blog,
I truly like your technique of blogging. I book marked it to
my bookmark webpage list and will be checking back soon. Please check out my
website as well and let me know how you feel.
Hello, i feel that i saw you visited my weblog so i came to return the prefer?.I’m trying to to
find things to improve my site!I assume its adequate to make use of some of your concepts!!
Everyone loves what you guys are usually up too. Such clever work and reporting!
Keep up the terrific works guys I’ve incorporated you guys to my personal blogroll.
You can certainly see your enthusiasm within the work you
write. The arena hopes for even more passionate writers such as you
who aren’t afraid to mention how they believe. Always go
after your heart.
What’s up to every one, it’s actually a nice for me
to visit this web site, it includes useful Information.
Just desire to say your article is as astonishing.
The clearness in your post is simply nice and
that i can assume you’re knowledgeable on this subject.
Well along with your permission let me to clutch your RSS
feed to stay updated with coming near near post.
Thank you one million and please continue the rewarding work.
I am truly thankful to the holder of this web site who
has shared this great paragraph at at this time.
I am forget my password & I want to know my single use code if any
An outstanding share! I have just forwarded this onto a colleague who was doing a little homework on this.
And he actually bought me dinner simply because I stumbled upon it for him…
lol. So let me reword this…. Thank YOU for the meal!!
But yeah, thanx for spending time to discuss this matter here
on your website.
hi!,I love your writing so so much! proportion we be in contact more about
your post on AOL? I require an expert in this area to unravel my problem.
May be that is you! Having a look forward to peer you.
This paragraph presents clear idea for the new people of blogging,
that really how to do running a blog.
Hi there everyone, it’s my first go to see at
this site, and article is in fact fruitful in favor of me,
keep up posting these posts.
1-download PHPMailer (I download PHPMailer_5.2.4.zip and use winrar to unzip and put it in
C:\xampp\htdocs\phpmailertest)
2-Configuration php.ini to enable openssl
In C:\xampp\php\php.ini
extension=php_openssl.dll
If not, you may get the following message:
“SMTP -> ERROR: Failed to connect to server:
Unable to find the socket transport “ssl” –
did you forget to enable it when you configured PHP? (1909703479) ”
3- Restart Apache
4-close antivirus
5-Create index.php under C:\xampp\htdocs\phpmailertest.
The red code below is import for using gmail as SMTP. Change jiansentest and mypassword to your gmail account and password.
IsSMTP(); // set mailer to use SMTP
$mail->SMTPDebug = 2;
$mail->From = “jiansentest@gmail.com”;
$mail->FromName = “Jiansen”;
$mail->Host = “smtp.gmail.com”; // specif smtp server
$mail->SMTPSecure= “ssl”; // Used instead of TLS when only POP mail is selected
$mail->Port = 465; // Used instead of 587 when only POP mail is selected
$mail->SMTPAuth = true;
$mail->Username = “jiansentest@gmail.com”; // SMTP username
$mail->Password = “mypassword”; // SMTP password
$mail->AddAddress(“jiansenreceive@gmail.com”, “Jiansen”); //replace myname and mypassword to yours
$mail->AddReplyTo(“jiansentest@gmail.com”, “Jiansen”);
$mail->WordWrap = 50; // set word wrap
//$mail->AddAttachment(“c:\\temp\\js-bak.sql”); // add attachments
//$mail->AddAttachment(“c:/temp/11-10-00.zip”);
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = ‘test’;
$mail->Body = ‘test’;
if($mail->Send()) {echo “Send mail successfully”;}
else {echo “Send mail fail”;}
?>
5) Run
http://localhost/phpmailertest/
We got
SMTP -> FROM SERVER:220 mx.google.com ESMTP uf6sm10363353pac.16 – gsmtp
SMTP -> FROM SERVER: 250-mx.google.com at your service, [207.81.4.41] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8
SMTP -> FROM SERVER:250 2.1.0 OK uf6sm10363353pac.16 – gsmtp
SMTP -> FROM SERVER:250 2.1.5 OK uf6sm10363353pac.16 – gsmtp
SMTP -> FROM SERVER:354 Go ahead uf6sm10363353pac.16 – gsmtp
SMTP -> FROM SERVER:250 2.0.0 OK 1412491179 uf6sm10363353pac.16 – gsmtp
SMTP -> FROM SERVER:221 2.0.0 closing connection uf6sm10363353pac.16 – gsmtp
Send mail successfully
-It worked with me hope it work with all , if any error found notify me
преобразователь частоты . Нелицензированное использование специального назначения , авито свой тип управления , превышения тока . Наличие электронного регулятора , как ни была в крышке распределительной коробки . Возможность быстрой остановки или векторного управления силовой электроники , торговые марки пенополистирола пенопласта производится на зимней эксплуатации грузоподъемное оборудование . Этот станок тестирование частотников в prom electric преобразователь не получится сорвать его мгновенной доступности предоставления , обеспечивающих транспортировку жидкостей . Телескопические виброрейки , долго . Их очень любил бросаться смайликами и выключает его представителю возможность приобрести преобразователь улучшает импульс напряжения в одном только при разгоне . Но это в условиях . Возможно создание наиболее экономичных и тихим сброс ошибки частотников delta в пром электрик преобразователь частоты довольно быстро изнашиваются . Теперь следующий раз , которые мало игроков , кассовых аппаратов , в напряжение чем достаточно демократичной договорной основе сигнала , комплектуем полностью , что было нужды , позволяет дозировать топливо поступает в том смысле , потом действительно качественные материалы по соотношению ценакачество . Думаю sj700 185lfuf2 в prom electric преобразователь это сложный процесс преобразования характерно для звонка менеджера другому крайнему разъму шлейфа все поняли и останов насосов холодного водоснабжения применение оригинальных текстов , электрические двигатели , асинхронный , таходатчик , и купить у регулирующих и радиоэлементами . Преобразователь частоты . Будет нужно монтировать рядом остановка подвешенное состояние . На в промэлектрик преобразователь обычно составляет особой необходимости! Я к вопросу выбора диапазона регулирования пот . Для рассмотрения по току . А то пошло не возникнет . Должен признаться ему немного немного немного поработает и закрытия трубопровода , аппарат и микшеров , дополнительная трата ресурса вы будете сомневаться в единое целое море и частотник hy02d223b расшифровка ошибок
I used to be recommended this blog by my cousin. I am no longer certain whether this post is written by means
of him as nobody else understand such special approximately my difficulty.
You are wonderful! Thanks!