Newbie HELP!!! Getting strange error - trying to use Mail
| From: | Bob McCormick | Date: | Thu, 21 Apr 2005 02:54:40 +0000 |
| Subject: | Newbie HELP!!! Getting strange error - trying to use Mail | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-18849@lists.php.net to get a copy of this message | ||
Newbie to PHP & PEAR here. Have upgraded to the latest version of Mail via command line: 'pear upgrade-all'
When I type 'pear list' at the command line - I see that Mail 1.1.4 is there.
I simply enter the following code that I cut and pasted in from the docs:
<?php
include('Mail.php');
$recipients = 'bobm@mydomain.com';
$headers['From'] = '<ScheduleRequest@adomain.com>'; $headers['To'] = 'bobm@mydomain.com';$headers['Subject'] = 'Test message'; $body = 'Test message'; //$params['sendmail_path'] = '/usr/lib/sendmail'; // Create the mail object using the Mail::factory method //$mail_object =& Mail::factory('sendmail', $params); $mail_object =& Mail::factory('mail'); $mail_object->send($recipients, $headers, $body); ?> Now, the strange thing here is that I'm getting the following error when I run this page: Parse error: parse error, unexpected T_STRING in pathtofile/ScheduleMail.php on line 4 WHY is it failing on line 4? Is the include not working??? Sorry for my denseness here - but it feels like the include isn't working which doesn't make any sense to me since I can do all of the pear commands on the prompt. Note that I'm running on Mac OSX (BSD Unix) I have also updated 'include_path = ' in the php.ini file. Line in php.ini reads 'include_path = ".:/php/includes:/usr/lib/php" Can anybody please help clue me in??? Appreciate any help someone could provide. Thanks...Bob Bob McCormick