php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62154 warning
Submitted: 2012-05-25 09:37 UTC Modified: 2012-05-25 14:47 UTC
From: puja_lakhotiya at yahoo dot co dot in Assigned:
Status: Not a bug Package: Website problem
PHP Version: 5.3.13 OS: windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: puja_lakhotiya at yahoo dot co dot in
New email:
PHP Version: OS:

 

 [2012-05-25 09:37 UTC] puja_lakhotiya at yahoo dot co dot in
Description:
------------
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() 


{got such error}


Test script:
---------------
<html><body>
<h2>Aliens Abducted Me - Report an Abduction</h2>
<?php
$when_it_happened=$_POST['whenithappened'];
$how_long=$_POST['howlong'];
$how_many=$_POST['howmany'];
$alien_description = $_POST['aliendescription'];
$what_did=$_POST['whattheydid'];
$fang_spotted = $_POST['fangspotted'];
$email = $_POST['email'];
$other=$_POST['other'];
$name=$_POST['firstname'] .''. $_POST['lastname'];
$to="pooja.kalantri@gmail.com";
$subject="Abducation Form";
$msg="$name you were abducted $when_it_happened and were gone for $how_long.\n".
"Number of alien:$how_many\n".
"describe Them:$alien_description\n".
 "The alien did this:$what_did\n".
"Was Fang there?  $fang_spotted\n".
"I want to add  $other";
mail($to,$msg, $subject ,"From:". $email);
echo 'Thanks for submiitting form.<br>';
echo 'you were abuducted' . $when_it_happened;
echo ' and were gone for ' . $how_long . '<br />';
echo 'Number of alien'. $how_many .'<br/>';
echo 'Describe them: ' . $alien_description . '<br />';
echo 'The alien did this:'. $what_did .'<br/>';
echo 'Was Fang there? ' . $fang_spotted . '<br />';
echo 'Your email address is ' . $email;
echo 'I want to add' . $other .'<br/>';
echo 'I am'.$name;
?>


</body></html>

Expected result:
----------------
get the mail in inbox

Actual result:
--------------
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()

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-25 14:44 UTC] reeze dot xia at gmail dot com
This is not a bug of PHP, 

The warning message explained everything. 

Please refer http://php.net/manual/en/function.mail.php in NOTE section.

BTW: I recommend search or ask such question on stackoverflow.com :)
 [2012-05-25 14:47 UTC] danbrown@php.net
-Status: Open +Status: Not a bug
 [2012-05-25 14:47 UTC] danbrown@php.net
"reeze dot xia at gmail dot com" is correct: this is not a bug in PHP, but rather 
an issue with your code, the configuration of PHP, or a problem with the 
server(s).  You may want to use the PHP General mailing list to ask for help with 
this issue.  You can subscribe to the list at http://php.net/mailinglists .
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 17:01:33 2025 UTC