473,473 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

mail() function always works fine, but hangs.

Just the simplest invocation with hard coded parameters, followed
by echoing a message, hangs for exactly 1 minute. ("defaulttimeout"
in php.ini is set to 30 (seconds)). If I don't wait, and immediately
hit the browser's "stop" button I get that "transfer interrupted"
message, but the email still gets sent and received just fine.
Sendmail is not running, "sendmail_path" is not set in php.ini, and
the email headers look as if the email was sent from the command line
using /bin/mail. Any thoughts on making mail() not hang, please?

Thanks,
Martin
Jul 17 '05 #1
3 6506
Hello,

On 01/19/2004 06:45 PM, martin wrote:
Just the simplest invocation with hard coded parameters, followed
by echoing a message, hangs for exactly 1 minute. ("defaulttimeout"
in php.ini is set to 30 (seconds)). If I don't wait, and immediately
hit the browser's "stop" button I get that "transfer interrupted"
message, but the email still gets sent and received just fine.
Sendmail is not running, "sendmail_path" is not set in php.ini, and
the email headers look as if the email was sent from the command line
using /bin/mail. Any thoughts on making mail() not hang, please?


This looks like you are trying to send messages from a server without a
DNS reverse record (PTR). If you do not know what that means, just let
me know the address of the server and I can check that for you.

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #2
Manuel Lemos <ml****@acm.org> wrote in message news:<bu************@ID-138275.news.uni-berlin.de>...
Hello,

On 01/19/2004 06:45 PM, martin wrote:
Just the simplest invocation with hard coded parameters, followed
by echoing a message, hangs for exactly 1 minute. ("defaulttimeout"
in php.ini is set to 30 (seconds)). If I don't wait, and immediately
hit the browser's "stop" button I get that "transfer interrupted"
message, but the email still gets sent and received just fine.
Sendmail is not running, "sendmail_path" is not set in php.ini, and
the email headers look as if the email was sent from the command line
using /bin/mail. Any thoughts on making mail() not hang, please?


This looks like you are trying to send messages from a server without a
DNS reverse record (PTR). If you do not know what that means, just let
me know the address of the server and I can check that for you.


That's correct, it's just my home machine which I use for development.
I added the test code to the file on the real server and it does not
hang. Is there a work-around for my home server? I read "out there"
some references to having the /etc/hosts entry correct. It's setup to
check /etc/hosts first. What's DNS got to do with it? The To: and From:
in mail() are both set to my earthlink.net address. I have two references
to my machine in /etc/hosts: "127.0.0.1 localhost loghost" and "<my IP
address> <my hostname>". There is no domain specified as there it has no
domain name. Does this relate? (Keep in mind that the emails go out OK.)

Thanks a lot,
Martin
Jul 17 '05 #3
Hello,

On 01/20/2004 12:45 AM, martin wrote:
Just the simplest invocation with hard coded parameters, followed
by echoing a message, hangs for exactly 1 minute. ("defaulttimeout"
in php.ini is set to 30 (seconds)). If I don't wait, and immediately
hit the browser's "stop" button I get that "transfer interrupted"
message, but the email still gets sent and received just fine.
Sendmail is not running, "sendmail_path" is not set in php.ini, and
the email headers look as if the email was sent from the command line
using /bin/mail. Any thoughts on making mail() not hang, please?


This looks like you are trying to send messages from a server without a
DNS reverse record (PTR). If you do not know what that means, just let
me know the address of the server and I can check that for you.

That's correct, it's just my home machine which I use for development.
I added the test code to the file on the real server and it does not
hang. Is there a work-around for my home server? I read "out there"
some references to having the /etc/hosts entry correct. It's setup to
check /etc/hosts first. What's DNS got to do with it? The To: and From:
in mail() are both set to my earthlink.net address. I have two references
to my machine in /etc/hosts: "127.0.0.1 localhost loghost" and "<my IP
address> <my hostname>". There is no domain specified as there it has no
domain name. Does this relate? (Keep in mind that the emails go out OK.)


Hanging often means either that the destination SMTP server is trying to
resolve domain of the origin IP address but it will fail after timeout,
or your ISP router is blocking port 25 (SMTP) outgoing connections to
any other SMTP server than theirs.

Either way the messages are probably hanging in your local MTA message
queue and the solution is to relay in a SMTP server that you have
authorization to relay messages, meaning your ISP.

If you are using Linux/Unix, you can relay in your to whatever SMTP
server your ISP is using by configuring your sendmail (or whatever local
MTA you use) to route the messages. You may also need to configure to
perform authentication which is very likely.

All the above is tricky and if you do not have enough skills you may
want to try this PHP only solution that is basically a mail class that
lets you configure the relay SMTP server and authentication credentials.
All you need to do is to make an include of smtp_mail.php and change
your calls to the mail() function just to smtp_mail().

http://www.phpclasses.org/mimemessage

You will also need this:

http://www.phpclasses.org/smtpclass
--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bernie Yaeger | last post by:
I have a simple mailsys solution that works splendidly. I decided to add a listview with file association icons to replace a listbox that displays the full path only of an attachment. But when I...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
9
by: LarryR | last post by:
The following XSLT works fine using MSXML 4.0 (e.g I receive a result in about 20 seconds), but effectively hangs in both .NET 1.0 sp2 with the XML hot fix and NET 1.1. My source XML file is...
6
by: Geoff Berrow | last post by:
I'm doing a bit of work for a guy and on his system the mail() function always returns false, but the mail is sent. Anyone come across this? Any ideas what is causing it and how to fix it? --...
9
by: shror | last post by:
hi every body, i have a problem which is when i was checking my mail() form it work fine but the problem is that the form configuration is not set correctly, in details: the from var is not...
12
by: e_matthes | last post by:
Hello everyone, I am trying to use the mail() function to send a simple, text-only message. I have two websites hosted by the same company, on different servers. One is old and established,...
3
by: Henry | last post by:
I have a simple form on a page in my website in which a user can enter an email address to be added to a mailing list. The following ASP script works the first time a user submits his or her...
1
by: rando1000 | last post by:
I'm having some trouble figuring out where the hangup lies on a connection issue. I have a domain with an MX record and A record pointing to a router. That router points ports 110 and 25 to an...
6
by: Call Me Tom | last post by:
The following simple script receives data from a form and sends me an email. It works fine on my testing machine (xampp for windows). However, when I upload it to my web host, the script processes...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.