Nick
Nick

Reputation: 1331

Sendmail() takes a long time to execute

I'm using sendmail from PHP (CakePHP 1.3) on a Linux Server (Ubuntu 10.10), and it's taking forever to execute, but eventually goes through. SMTP is running as a daemon -- for a while, I thought the problem was that it had to start the process on each send().

I am a bit of a novice when it comes to server configuration, so any help is appreciated.

Here is my application code, for reference:

            $this->Email->from    = 'Hello <[email protected]>';
            $this->Email->to      = 'Hello <[email protected]>';
            $this->Email->subject = 'Hello';
            $this->Email->sendAs = 'html';
            $this->Email->template = 'my_template';
            $this->data['Inquiry']['id']= $this->Inquiry->id;
            $this->set('inquiry', $this->data['Inquiry']);
            $this->Email->send();

Upvotes: 1

Views: 1534

Answers (1)

Nick
Nick

Reputation: 1331

And, of course, I found the solution myself immediately after posting the question.

I omitted this essential line from my code:

$this->Email->delivery = 'smtp';

Hope this is useful to others!

Upvotes: 2

Related Questions