mail with pear... i don't understand...

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

hi all

i must send a mail from a php form. ok. i have pear installed. ok.

this is my code:

$recipients    = "";
$headers["To"] = "";
$params["host"] = "";
$params["port"] = "25";
$params["auth"] = true;
$params["username"] = "";
$params["password"] = "password";
$headers["Subject"] = "Test Mail";

$mail_body = "\r\n";
$mail_body .= "-----------------------------\r\n";
$mail_body .= "TEST MAIL TEST MAIL TEST MAIL\r\n";
$mail_body .= "-----------------------------\r\n";
$mail_body .= "\r\n";

$mail_object =& Mail::factory("smtp", $params);
$mail_object->send($recipients, $headers, $mail_body);

the thing I can't understand is: i try to make this code connect to
mailserver A (, with authentication, and all is ok. no, not
all: I write to 2 differents address (by changing the parameters in the
code) and an address receives mail, the other one doesn't receive any mail.
I try to use the same server by using my standard mail client, and I can
reach both address. first thing I don't understand. someone can tell me
what's happening? :-)

the second thing is that if I try to use another mailserver
( the script doesn't run at all. I try to strip away
the auth code, but nothing. maybe the server must have some option
enabled/disabled to be reachable by php/pear?

thanx in advance

La bella che guarda il fiume ha un nome che fa paura...
La bella che Ŕ addormentata ha un nome che fa paura:
LibertÓ! LibertÓ! LibertÓ!

Re: mail with pear... i don't understand...

L'astemio wrote:
Quoted text here. Click to load it

Most likely, the second server filters PHP-generated messages out
based on something it reads in the message headers.  Compare the
headers of PHP-generated message with those of the message sent
with a standard client program; this may give you some clues.

Quoted text here. Click to load it

Are any error messages displayed?


Site Timeline