SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question fsockopen error number 1 Operation not permitted

    I am getting this error when the code reaches fsockopen function, i am using phpmailer class files with SMTP as outgoing mail method.

    Can anyone please explain what does it mean and how to proceed from here.

    What to should i check in my php installation to find out the cause of this issue.

    Thanks in advance.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Can you show the exact code causing the error?

  3. #3
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thankyou for your reply

    I am not getting any error code as it failed to open the socket. I am using the PHPmailer class function.

    Here is the code which i used

    //connect to the smtp server

    $this->smtp_conn = fsockopen($host, # the host of the server
    $port, # the port to use
    $errno, # error number if any
    $errstr, # error message if any
    $tval); # give up after ? secs
    # verify we connected properly


    if(empty($this->smtp_conn)) {
    $this->error = array("error" => "Failed to connect to server",
    "errno" => $errno,
    "errstr" => $errstr);
    if($this->do_debug >= 1) {
    echo "SMTP -> ERROR: " . $this->error["error"] .
    ": $errstr ($errno)" . $this->CRLF;
    }
    return false;


    When i run the code the connenction is failed.

    thanks

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Are you able to test this locally or do you not have an environment set up for that?

    Your web host may have blocked the ability to write to sockets.

  5. #5
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, we do have an separate environment for this and they havent blocked the ability to write to sockets


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •