0

this is my code for sending mail through xampp i have modified the php.ini and sendmail.ini from the xampp . Upon running the php i'm not getting email. Please help me .

php.ini

[mail function]

 SMTP =smtp.gmail.com <br>
 smtp_port =587

; For Win32 only.

 ;sendmail_from =email@gmail.com

sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

sendmail.ini

smtp_server=smtp.gmail.com

; smtp port (normally 25)

smtp_port=587

auth_username=email@gmail.com <br>
auth_password=password <br>
force_sender=email@gmail.com

The php code used for sending email is this

mail("garvit.j742@gmail.com","subject","this is the mail","From:     email@gmail.com");


this is my code for php. Tell me the errors ??

AnFi
  • 10,493
  • 3
  • 23
  • 47
ak47_kalani
  • 15
  • 1
  • 8
  • Tell us the errors. Are you getting any? Have you checked the error logs? – Jay Blanchard Jul 07 '14 at 12:17
  • possible duplicate of [How to configure XAMPP to send mail from localhost?](http://stackoverflow.com/questions/15965376/how-to-configure-xampp-to-send-mail-from-localhost) – Jay Blanchard Jul 07 '14 at 12:21
  • yes it is the duplicate of the same question . I followed it but still wasnt able to send the mail – ak47_kalani Jul 07 '14 at 15:36
  • i checked the error log .
    "Socket Error # 11001Host not found" . This was the error in the error.log
    – ak47_kalani Jul 07 '14 at 15:37
  • i have been working for 3 days , and have tried all the possibilities form various websites but still can;t get the mail .i'm using the exact code mentioned above . please rectify the error asap. if you want i can upl the screenshot – ak47_kalani Jul 07 '14 at 15:45

1 Answers1

0

I got this error today too. I found this working solution in SO. Just change sendmail.exe file's compatibility mode to Windows XP SP 3.

  1. Right click sendmail.exe and goto properties
  2. change compatibility mode to Windows XP SP 3

You can find Original post here

Malinda
  • 358
  • 5
  • 18