anyone using php5 and the PEAR Mail to send smpt mail?
require_once ('PEAR.php');
require_once ('Mail.php');
$recipients = 'my email';
$headers['From'] = 'doesnt matter';
$headers['To'] = 'my email';
$headers['Subject'] = 'this is a test';
$params['host'] = 'my smtp outgoing mail host';
$params['port'] = '25';
$params['auth'] = TRUE;
$params['username'] = 'my email';
$params['password'] = 'my password';
$body = 'testing 1 2 3';
$mail = &Mail::factory('smtp', $params);
$mail->send($recipients, $headers, $body);
Here are some other details about my setup that might be useful:
When I type pear config-show
Configuration:
==============
auto_discover <not set>
default_channel pear.php.net
preferred_mirror pear.php.net
remote_config <not set>
PEAR executables directory bin_dir /usr/local/php5/bin
PEAR documentation directory doc_dir /usr/local/php5/lib/php/doc
PHP extension directory ext_dir /usr/local/php5/lib/php/extensions/no-debug-non-zts-20050922
PEAR directory php_dir /usr/local/php5/lib/php
PEAR Installer cache directory cache_dir /tmp/pear/cache
PEAR data directory data_dir /usr/local/php5/lib/php/data
PHP CLI/CGI binary php_bin /usr/local/php5/bin/php
PEAR test directory test_dir /usr/local/php5/lib/php/test
Cache TimeToLive cache_ttl 3600
Preferred Package State preferred_state stable
Unix file mask umask 22
Debug Log Level verbose 1
HTTP Proxy Server Address http_proxy <not set>
PEAR server master_server pear.php.net
PEAR password (for password <not set>
maintainers)
Signature Handling Program sig_bin /usr/local/bin/gpg
Signature Key Directory sig_keydir /usr/local/php5/etc/pearkeys
Signature Key Id sig_keyid <not set>
Package Signature Type sig_type gpg
PEAR username (for username <not set>
maintainers)
I do notice when I look at a page with phpinfo() I don't see anything about PEAR. I wasn't sure if I am supposed to see something about PEAR in there or not. In any case, when I comment out that last line of code with the send function the page loads like it should. Anyone have any thoughts?
Dual G4 Quicksilver 1 GHz Mac OS X (10.4.6)