php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5743 mail() hangs if SMTP server is localhost
Submitted: 2000-07-23 10:54 UTC Modified: 2000-09-04 20:28 UTC
From: steve at srtware dot com Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0 Release Candidate 2 OS: Windows 98 SE
Private report: No CVE-ID: None
 [2000-07-23 10:54 UTC] steve at srtware dot com
The PHP version number above is wrong, my version (PHP 4.0.1pl2 - 30 June 2000) is not available as a choice on this form.

Others have reported this with IIS 4.0 and 5.0; I just wanted to say I have duplicated this in Windows 98SE using Personal Web Server.

Line to reproduce:
$mailsent  = mail($recipient, $subject, "join $ListName, $EMail, $Name", "From: $EMail ($Name)");

The problem happens if the SMTP address in php.ini resolves to 127.0.0.1.  I used "localhost" as well as other entries in my "hosts" file.  After changing to an external mail server (and rebooting) it worked fine first try.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-23 12:52 UTC] steve at srtware dot com
To clarify the subject, the symptoms I see is that the browser (IE 5.01) waits indefinitely, while the SMTP server (in my case Spartacom's XtraMail) shows the initial connection but the connection never closes.

It may time out eventually; I didn't wait more than a few minutes.  However it's instantaneous using an external mail server.  I do see an error from PHP in the browser if I stop the SMTP server while it's in this state.  (The error simply indicates that mail() failed, which is correct at that point).
 [2000-09-04 20:28 UTC] sniper@php.net
This should be fixed in php4.0.2. Reopen this bug report if problem
still exists.

--Jani
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Apr 30 03:01:27 2025 UTC