943,749 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 515
  • PHP RSS
May 28th, 2008
0

php mailing not working. any help me?

Expand Post »
php mailing not working. any help me?


i used the code to send mail is as follows:
<?php
$to = "someone@example.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>


when i am executing i am getting following 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:\Program Files\xampp\htdocs\samplemuthu\file.php on line 7
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
muthu raj is offline Offline
10 posts
since Apr 2008
May 28th, 2008
0

Re: php mailing not working. any help me?

it doesnt look like your mailserver settings are correct in your php.ini file. this article will help you with this setup.
http://www.sitepoint.com/article/advanced-email-php
Reputation Points: 31
Solved Threads: 29
Posting Whiz in Training
ProfessorPC is offline Offline
270 posts
since Dec 2007
May 28th, 2008
0

Re: php mailing not working. any help me?

Hi,
  1. Search your computer for the 'php.ini' file....
  2. Once you have found it's location, open it using Notepad.exe
  3. Click Edit - Find and enter [mail function] now search for it within the document
  4. You should find this:

    [mail function]
    ; For Win32 only.
    SMTP = localhost
    smtp_port = 25

    ; For Win32 only.
    ;sendmail_from = me@example.com

    ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
    ;sendmail_path =sendmail -t -i
Reputation Points: 48
Solved Threads: 1
Posting Pro
maydhyam is offline Offline
555 posts
since Feb 2008
May 28th, 2008
0

Re: php mailing not working. any help me?

Hi,You can use sleep() function just after mail($to,$subject,$message,$headers);
like this

mail($to,$subject,$message,$headers);
sleep(5);

may be it will works.


Click to Expand / Collapse  Quote originally posted by muthu raj ...
php mailing not working. any help me?


i used the code to send mail is as follows:
<?php
$to = "someone@example.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>


when i am executing i am getting following 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:\Program Files\xampp\htdocs\samplemuthu\file.php on line 7
Reputation Points: 11
Solved Threads: 7
Junior Poster in Training
phpuser is offline Offline
55 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: PHP data retrieval from SQL problem
Next Thread in PHP Forum Timeline: Market Message Transfer Protocol et php





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC