3 Replies - 2980 Views - Last Post: 02 August 2011 - 08:15 AM Rate Topic: -----

#1 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

how to configure smtp setting to send email + php

Posted 02 August 2011 - 06:25 AM

hi all,

I am new to php and was trying to send an email .


i got the code from w3school site.
[url]http://www.w3schools.com/php/php_mail.asp[/url]

but when I run the code i got this error.


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:\xampp\htdocs\PhpProject3\aa.php on line 17

i don't know how to configure php.ini

can any body to correct this error.

thx in advance,
menuka

Is This A Good Question/Topic? 0
  • +

Replies To: how to configure smtp setting to send email + php

#2 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 947
  • View blog
  • Posts: 2,355
  • Joined: 15-February 11

Re: how to configure smtp setting to send email + php

Posted 02 August 2011 - 06:40 AM

Download, install and configure a mail server. Check out hMailServer
Was This Post Helpful? 0
  • +
  • -

#3 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

Re: how to configure smtp setting to send email + php

Posted 02 August 2011 - 07:17 AM

hi all I have done this with java class jsp/servlet .. but I don't know why in php it is tough.....

I mean i did it without installing mail server. then why php needs?
isn't there any possible way to do this?
Was This Post Helpful? 0
  • +
  • -

#4 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 947
  • View blog
  • Posts: 2,355
  • Joined: 15-February 11

Re: how to configure smtp setting to send email + php

Posted 02 August 2011 - 08:15 AM

Java and PHP are two different languages. PHP's mail() function needs to connect to an SMTP server through port 25 in order to send mails. The mail isn't sent directly from PHP if you thought so but simply through the local SMTP server.

But you can check out no2pencil's tutorial. Should be of use to you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1