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/