Re: [PHP] PHP SMTP Mailers
[email protected] ("King Coffee")
| Newsgroups | php.general |
|---|---|
| Message-ID | <[email protected]> |
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 = "[email protected]"; $password = "Password"; $from = "King Coffee <[email protected]>"; $to = "Bill <[email protected]>"; $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