Re: PHP SMTP Mailers

From: Date: Sun, 21 Mar 2010 14:04:58 +0000
Subject: Re: PHP SMTP Mailers
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-303075@lists.php.net to get a copy of this message
Thanks Jan G. B., You got me over the first hump. I'm having programs installing pear on my VISTA localhost... So, I uploaded the Mail folder and Mail.php file to my Shared Hosting ISP. I do not think pear is provided. The Testing is as follows: <?php require_once "Mail.php"; // SSL HOST $host = "ssl://smtp.gmail.com"; $port = "587"; $username = "Sender@gmail.com"; $password = "Password"; $from = "King Coffee <Sender@gmail.com>"; $to = "Bill <Recipient@hotmail.com>"; $subject = "PHP Mail Test"; $body = "This is a simple mail test!"; $headers = array('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $header, $body); if(PEAR::isError($mail)) { echo( "<p>" . $mail->getMessage() . "</p>"); } else { echo("<p>Message successfully sent</p>"); } ?> <html> <head> <title>PHP EMAIL TESTER</title> <h1>This is a test</h1> <?php Echo "Hi King"; ?> </head> </html> When I run the server page, The following error is displayed: Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in D:\Hosting\ID#\html\auction\Mail.php on line 46 Fatal error: require_once() [function.require]: Failed opening required 'PEAR.php' (include_path='.;C:\php5\pear') in D:\Hosting\ID#\html\auction\Mail.php on line 46 I will be still trying the get pear installed in VISA, but meanwhile, how can I obtain the PEAR.php and supporting files to upload? Thanks, King

« previous php.general (#303075) next »