Page 1 of 1

couple of problems with Filezilla and PEAR::mail

Posted: Tue Mar 25, 2008 2:29 pm
by highjo
hello! guys
I have a couple of problems playing around with mail and ftp aspect of php.
I'm on windows Xp with xampp 1.6.5.
the major problem is about filezilla server. i have two default users anonymous and newuser which are enabled and the server is a service that starts at startup.
my codes :
i'am having the same message of the first die even after trying the loopback address 127.0.0.1

Code: Select all

 
<?php 
set_time_limit(0);
if (!pointer = ftp_connect('localhost'))
{
    die('could not connect to ftp server');
}
if(!ftp_login($pointer,'newuser','wampp'))
{
    die('login failed');
 
}
 
?>
 
any idea?

the second problem is about the PEAR Mail package.
the problem is that, a mail send with mail class doesn't show the subject here is the code

Code: Select all

 
<?php 
error_reporting(E_ALL);
include_once('Mail.php');
$mail = Mail::factory('mail');
$headers = array('from' => 'postmaster@localhost', 'Subject' => 'PEAR');
$go=$mail->send('admin@localhost',$headers,'this is send with the pear mail factory with subject');
if(PEAR::isError($go))
{
//some echo with $go->getMessage();
}
else
{
//some message
}
?>
 
don't know why can't see this the subject in my outlook express.but can it if it's sent with built in mail function i see the subject.

the third problem is about SMTP.my mercury is (i guess) working properly
still with pear i see:mail sendind failed :Failed to connect to smtp.localhost:25 [SMTP: Failed to connect socket: (code: -1, response: )]
after running this

Code: Select all

 
<?php 
include_once('Mail.php');
$mail = Mail::factory('smtp', array('host' => 'smtp.localhost'));
$headers = array('From' => 'postmaster@localhost', 'CC' => 'newuser@localhost', 'Subject' => 'Carbon Copy');
$go = $mail->send('admin@localhost',$headers, 'a try with pear for carbon copy');
if(PEAR::isError($go))
{
//some echo with $go->getMessage();
}
else
{
//some message
}
?>
 
in my php.ini i change in [mail -function] SMTP = localhost but still
any idea? thanks

Re: couple of problems with Filezilla and PEAR::mail

Posted: Tue Mar 25, 2008 3:55 pm
by Ambush Commander
What port is Filezilla running on? You might have to specify that.

As for PEAR mail, I really can't say. The header is correct... maybe a bug in the library? Check the message source in outlook to see if "Subject" is showing up.

smtp.localhost doesn't mean anything unless you've assigned that subdomain an IP address in your HOSTS file. (the same way smtp.127.0.0.1 doesn't mean anything either). Does localhost work?

Re: couple of problems with Filezilla and PEAR::mail

Posted: Mon Mar 31, 2008 2:59 pm
by highjo
hello first sorry for the delay :oops: .For your answer the localhost is working and the filezilla is working on port 21.