When I go to tools -> communicate and try to send an email (with my smtp configuration that was previously working fine) I get the following error:

Message: fsockopen() [function.fsockopen]: unable to connect to smtp.mandrillapp.com:25 (Operation not permitted)

Filename: libraries/Email.php

Line Number: 1670

Does anyone have an idea about why this is happening?

To me it's weird because previously emailing worked fine... It's been a while since I last sent email, but I didn't change any email related config since then...

  • What's on line 1670 of the libraries/Email.php file?
    – Anna_MediaGirl
    Jan 22, 2013 at 18:01
  • Basically this (simplified): fsockopen("smtp.mandrillapp.com", 25, $errno, $errstr, 30);
    – Jan Paul
    Jan 23, 2013 at 3:04

2 Answers 2


Try using port 587 instead of port 25.

And check phpinfo() to see if any socket functions are disabled or you contact your host. They may have writing disabled as per this answer.

  • I tried port 587 and it's working, thanks for the suggestion. It seems like I have to hack this into the ci/libraries/email.php file though, is there no better way to change the smtp port that's EE upgrade proof?
    – Jan Paul
    Jan 23, 2013 at 6:38
  • Not sure on that question. But keeping a CHANGES.txt file on the server with files paths, code changes and line numbers will make upgrading pretty quick if you have to go that route. Select my answer as correct by clicking on the checkmark to the left if it fixed your issue.
    – Anna_MediaGirl
    Jan 23, 2013 at 16:53

Looks like your network is blocking connections to that domain, possible due to the fact it is using SMTP. It's recommended you use their web API for this purposes. REST API calls are just standard HTTP, so if your host/server is blocking requests over the SMTP port, the SMTP calls with fail while the regular HTTP requests will succeed. It should be noted, I am purely speculating based on the limited information in this report. I have read many reports about this stuff, but never experienced it directly.

The easiest way to use the Mandrill API to send email for virtually anything, included all system emails in Postmaster. Email support[at]objectivehtml.com if you have any Postmaster specific questions.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.