This is a discussion on email using PEAR within the PHP Language forums, part of the PHP Programming Forums category; I grabbed the following script from a website and installed the Socket.php file in the /usr/share/pear/Net ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I grabbed the following script from a website and installed the
Socket.php file in the /usr/share/pear/Net directory on a RH 8.0 Linux box. When I run the script it displays the "Mail sent" message but no mail actually arrives in my mailbox. include("Mail.php"); $recipients = "brunowright@yahoo.com"; $headers["From"] = "brunowright@yahoo.com"; $headers["To"] = "brunowright@yahoo.com"; $headers["Subject"] = "Test message"; $body = "TEST MESSAGE!!!"; $params["host"] = "my.smtp.server"; $params["port"] = "25"; $params["auth"] = true; $params["username"] = "myusername"; $params["password"] = "mypassword"; // Create the mail object using the Mail::factory method $mail_object =& Mail::factory("smtp", $params); $mail_object->send($recipients, $headers, $body); echo "Mail has been sent!!\n"; ?> I was told that it was much easier to use PEAR than to try setting up sendmail on my system. Any comments would be greatly appreciated. David |