Page 1 of 1

php mail REALLY slow

Posted: Fri Feb 18, 2005 10:38 am
by snakeman
The following code is what I've been using for a long time. Now that I've changed servers, I had a hard time getting the mail function to work but now that I've got it working, it is EXTREMELY slow. Any ideas?

mail('info@mysite.com', $subject, $emailtext, $From) or
Die("Error sending mail :(");

I've got fedora1, php 4.3.8, sendmail, dovecot

Thanks so much for any help... By the way, getting and sending mail using a mail program like Outlook works great.

Posted: Sat Feb 19, 2005 5:08 am
by snakeman
Nobody want to respond? Please? :D

Posted: Sat Feb 19, 2005 5:11 am
by markl999
Well we can only guess but what's $From? I presume it's a proper From header and not just a plain email address?

Also if you have server access then watch your mail.log file as you test the script, you should be able to at least find out if the 'blockage' is on the PHP side or the email side.

Posted: Sat Feb 19, 2005 7:27 am
by jonemo
do you use sendmail or a smtp server?

Posted: Sat Feb 19, 2005 6:53 pm
by snakeman
sendmail

Here's what $From is...

$Sender = "someaddress <this@someaddress.com>\r\n";
$From .= 'From: ' . $Sender;
$From .= "X-Mailer: PHP\n"; //mailer
$From .= "X-Priority: 1\n"; //1 UrgentMessage, 3 Normal
$From .= "Content-Type: text/html; charset=iso-8859-1\n";

Posted: Sat Feb 19, 2005 7:01 pm
by feyd
have you tried changing/removing the priority setting? Is mail() being called multiple times? Is the mail server shared among several domains at the host?

Posted: Sat Feb 19, 2005 8:24 pm
by snakeman
It's shared but that's definitely not what's slowing it down. It's the only site using the mail function right now. Getting and receiving mail any other way is fast as lightening. Something's whack cause it takes like forever.

Posted: Sat Feb 19, 2005 8:37 pm
by feyd
why not, like, talk to your host, sha?

Posted: Sat Feb 19, 2005 11:42 pm
by snakeman
That's why I'm trying to figure this out. I am my host. 8O

Posted: Sat Feb 19, 2005 11:51 pm
by feyd
oh, ok. well, from a quick google, it looks like sendmail combined with your network connection type and/or DNS resolution system.

"sendmail slow" was my google.