Gayner Posted September 14, 2009 Share Posted September 14, 2009 wHy is that? Is it part of php or my server? Link to comment https://forums.phpfreaks.com/topic/174151-php-mail-taking-a-long-time-to-be-delivered/ Share on other sites More sharing options...
PolarisX Posted September 14, 2009 Share Posted September 14, 2009 In my experience its usually server side, i know a couple of servers ive had where mail took an extremely long time to send. On those occasions i usually just use Pear's SMTP functions: $from = "Name Here <[email protected]>"; $to = "Name Here <[email protected]>"; $subject = "Subject Here"; $host = "smtp.servername.com"; $username = "email_username"; $password = "email_password"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject ); $smtp = Mail::factory ( 'smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password ) ); $mail = $smtp->send ( $to, $headers, $body ); if (PEAR::isError ( $mail )) { echo ("<p>" . $mail->getMessage () . "</p>"); } else { echo ("<p>Message successfully sent!</p>"); } A little bit harder than using the mail function but atleast it sends the mail immediately. Link to comment https://forums.phpfreaks.com/topic/174151-php-mail-taking-a-long-time-to-be-delivered/#findComment-918055 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.