PEAR Mail.php

Status
Not open for further replies.

sorvigolova3

New Member
Messages
2
Reaction score
0
Points
0
Hello! I'm trying to use PEAR mail functionality on my site but it seems like the PEAR Mail is not installed on free accounts by default. How can I install additional PEAR packages?
 

sorvigolova3

New Member
Messages
2
Reaction score
0
Points
0
Hi!
Thanks for your help guys!
I have installed pear and mail package but when I try to send email from my site I got an error
HTML:
 <p>Failed to connect to  mail.autopia.x10hosting.com:25 
     [SMTP: Failed to connect socket: fsockopen() 
     [<a href='function.fsockopen'>function.fsockopen</a>]: 
     unable to connect to  mail.autopia.x10hosting.com:25 
     (php_network_getaddresses: getaddrinfo failed: 
     Name or service not known) (code: -1, response: )]</p>
What I'm doing wrong?
BTW I have tried to use another smtp server and I got the same error. But when I test my code on my PC localy using this remote smtp server everithing works fine.
 
Last edited:

calistoy

Free Support Volunteer
Community Support
Messages
5,602
Reaction score
87
Points
48
fsockopen() is disabled on the free servers for security reasons. Maybe posting a thread in third-party script section of these forums will help you with a solution.


Edit: Disregard my advice. It turns out that I was mistaken and wrong.
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
fsockopen() is disabled on the free servers for security reasons.

Wrong.

PHP:
<?php
    function getTheNews() {
 
$fp = fsockopen("www.cnn.com", 80, $errno, $errstr, 30);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    $out = "GET / HTTP/1.1\r\n";
    $out .= "Host: www.cnn.com\r\n";
    $out .= "Connection: Close\r\n\r\n";
    fwrite($fp, $out);
    while (!feof($fp)) {
        echo fgets($fp, 128);
    }
    fclose($fp);
}
}
 
    getTheNews() ;
?>

works when I run it from Chopin.

Haven't done socket programming in awhile, but the key error seems to be


unable to connect to mail.autopia.x10hosting.com:25
(php_network_getaddresses: getaddrinfo failed:
Name or service not known) (code: -1, response: )]

in the address somehow or maybe with the DNS lookup
 
Last edited:

adrenlinerush

New Member
Messages
379
Reaction score
1
Points
0
I'm thinking that it is disabled or ports are blocked... atleast on Absolut... I have code that is in production on another web server that works fine but on here I get a timeout with fsocketopen()...

[05-Jan-2010 20:44:08] PHP Warning: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://mail.adrenlinerush.net:993 (Connection timed out) in /home/adrenlin/public_html/x10.adrenlinerush.net/mail/program/lib/imap.inc on line 611
[05-Jan-2010 15:44:08 -0500] IMAP Error: Could not connect to ssl://mail.adrenlinerush.net at port 993: Connection timed out (POST /x10.adrenlinerush.net/mail/?_task=&_action=login)
Edit:
any ideas?
Edit:
anyobody able to use fsocketopen on Absolut?
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
anyobody able to use fsocketopen on Absolut?

Did you try my code from your account? That will tell you if fsockopen is disabled (since Port 80 is not blocked). Then, if it fails on other ports, it is an issue with ports being blocked, not fsockopen.
 
Status
Not open for further replies.
Top