ID: 15373
Comment by: omgmain at gmail dot com
Reported By: alonso at admintek dot net
Status: No Feedback
Bug Type: Mail related
Operating System: win2000
PHP Version: 4.2.1
Assigned To: mfischer
New Comment:
Hi,
I am also having the same problem with this. I am using Mac OS X, and
it doesn't seem to be sending.
Script:
<?php
if(!mail($_POST['email'],"blabla","$text_body")){
echo("Unable to send verification email.");
}else{
echo("Sent verification email.");
}
?>
Mail seems to always return true.
Previous Comments:
------------------------------------------------------------------------
[2009-03-27 11:37:05] real_ganesh at yahoo dot co dot in
Am php to send E-mail,but will be Error.
Failed to connect to mailserver at "localhost" port 25, verify your
"SMTP" and "smtp_port" setting in php.ini or use ini_set() in
-----code----
Contact.html
-----------
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html;>charset=iso-8859-1" />
<title>Cultuzz Digital Media GmbH - Contact</title>
</head>
<center>
<body bgcolor="FF9900">
<div class="componentheading"><h1>Contact Us</h1></div>
<table width="50%" cellpadding="0" cellspacing="0" border="0"
class="contentpane">
<!-- <form action="../Contactus/Contact1.php" method="post"> -->
<form action="../Contactus/Mailto.php" method="post">
<table>
<!-- <body background="FF9900"> -->
<tr>
<td align="right" class="w"><b>Enter your To
Address:</b></font></h3></td>
<td><input type="text" name="toAddr" size="25"></td>
</tr>
<tr>
<td align="right" class="w"><b>E-mail your From
Address:</b></font></td>
<td><input type="text" name="fromAddr"
size="25"></td>
</tr>
<tr>
<td align="right" class="w"><b>Enter your
Password:</b></font></td>
<td><input type="password" name="toPass"
size="25"></td>
</tr>
<tr>
<td align="right" class="w"><b>Enter your
Subject:</b></font></td>
<td>
<input type = "text" name="subject" size="25">
</td>
</tr>
<tr>
<td align="right" class="w"><b>Enter your
Content:</b></font></td>
<td>
<textarea name="content" size="20" cols="25"
rows="7"></textarea>
</td>
</tr>
<tr>
<td>
<center>
<input type="submit" name="submit"
value="Submit">
</center>
</td>                 
                    
</tr>
</body>
</table>
</form>
</body>
</center>
</html>
<!-- <textarea name="content" size="20" cols="25" rows="7" value="<?php
echo $_POST['content']; ?>"></textarea> -->
---------------------
mailto.php
----------------------
<!-- Mail to multiple recipients
-->
<?php
/*$headers = "From:[email protected]\r\n";
$recipients = "[email protected],[email protected]";
mail($recipients, "This is the subject","This is the mail body",
$headers);
*/
/* $SMTP = 10.200.10.7
$smtp_port = 25*/
$toAddr = "toAddr";
$fromAddr = "fromAddr";
$toPass = "toPass";
$subject = "subject";
$content = "content";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' .
"\r\n";
$headers .= 'From: [email protected]\r\n' .
'Reply-To: [email protected]\r\n';
//u can add
//$headers .= 'CC : [email protected]\r\n';
//$headers .= 'BCC : [email protected]\r\n';
mail($toAddr, $fromAddr, $toPass, $subject,$content);
echo "This is To---------------->: $toAddr <br/>";
echo "This is From----------->: $fromAddr <br/></n>";
echo "This is Password----------->: $toPass <br/>";
echo "This is Subject----------->: $subject <br/></n>";
echo "This is Content----------->: $content <br/></n>";
echo "This is Headers----------->: $headers <br/></n>";
?>
------------------------------------------------------------------------
[2009-03-19 00:47:46] rmsadik dot ece at gmail dot com
i have problem sending email using mail(). it was working couple of
weeks before but now on its not working ...i dont know whats the problem
and here is the code
if ($db_result) {
echo "Successful";
$to = $email;
$from = "[email protected]";
$subject = "Password Request From";
$message = "PLEASE DO NOT REPLY TO THIS EMAIL\n\n";
$message .= "unless others can read your email.\n\n\n";
$message .= "Password: ".$password;
$headers = "From: ".$from;
// Set the name of the server for mail processing. This should
be
handled at the server level but the following
// statement allows dynamic setting of the SMPT server for
testing
purposes.
ini_set("SMTP","mail.sunet.com.au");
// Attempt to send the mail message.
//$db_result = mail($to,$subject,$message,$headers);
mail($to,$subject,$message,$headers);
}
------------------------------------------------------------------------
[2008-11-25 17:17:49] jeff at jouster dot org
I have this same problem.
I have Windows Server 2003 SP2 IIS 6. PHP6-dev (also same problem with
5.4)
Port 25 is open and I can telnet to the server from my home machine
completely outside the network and manually send an email. So I know
that SMTP is not the problem and relaying is not a problem.
Here's my script:
<?php
$success = mail("[email protected]", "subject", "body", "From: My Name
<[email protected]>");
echo ($success);
if ($success)
{
echo (" success!");
}
else
{
echo (" problem...");
}
?>
When I run this test script I see:
1 success!
However I never get an email. I have php.ini set to log errors (have
also tried display errors) and there is never any errors logged or
displayed.
php.ini SMTP section:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
sendmail_from = [email protected]
phpinfo() shows all of this information properly (only after I moved
the .ini file into the PHP install directory.
I have PHPRC environment variable set to PHP install directory and have
added same directory to my PATH env var.
Mail was successfully being sent until another issue caused me to
uninstall and reinstall the SMTP Service portion of IIS.
I see no solutions or cause to this problem in this thread. Any new
news? Original issue was posted 6 years ago... I can't believe this is
still cropping up for people.
------------------------------------------------------------------------
[2008-07-10 15:47:04] phpseven at yahoo dot com
smtp server can't run. i tried my best to solve it but it can't send
the mail.
------------------------------------------------------------------------
[2007-10-25 11:13:44] vvel3000 at yahoo dot co dot in
Warning: mail() [function.mail]: Failed to connect to mailserver at
"mail.yourisp.com" port 25, verify your "SMTP" and "smtp_port" setting
in php.ini or use ini_set() in C:\wamp\www\1.php on line 7
There was an error
why so you error
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/15373
--
Edit this bug report at http://bugs.php.net/?id=15373&edit=1