 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
hill79
Joined: 02 Apr 2008 Posts: 5
|
Posted: Wed Apr 02, 2008 1:20 pm Post subject: send() undefined? |
|
|
I've just installed the Mail package and can't get it to work correctly. I also installed the net_smtp and net-socket dependencies.
When I run this script...
| Code: |
require_once "Mail.php";
$recipients = 'me@mydomain.co.uk';
$headers['From'] = 'shopping@xxxx.com';
$headers['To'] = 'me@mydomain.co.uk';
$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->send($recipients, $headers, $body);
|
I get this output
| Quote: |
Fatal error: Call to undefined function: send() in C:\Home\f\o\foodlocalfood.co.uk\mailtest.php on line 48 |
any ideas anyone? |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1011
|
Posted: Wed Apr 02, 2008 5:32 pm Post subject: |
|
|
Maybe an issue with the include_path setting?
Please add after | Code: | | $mail_object =& Mail::factory('sendmail', $params); | an error check:
| Code: |
if (PEAR::isError($mail_object)) {
die($mail_object->getMessage . ', ' . $mail_object->getDebugInfo());
}
|
|
|
| Back to top |
|
 |
hill79
Joined: 02 Apr 2008 Posts: 5
|
Posted: Wed Apr 02, 2008 5:37 pm Post subject: |
|
|
thanks for the reply, although I don't think the output from that debug script is going to help much! this is what I get...
and that's it! literally just a comma! |
|
| Back to top |
|
 |
hill79
Joined: 02 Apr 2008 Posts: 5
|
Posted: Wed Apr 02, 2008 5:44 pm Post subject: |
|
|
| never mind - resorted to using phpmailer which I got working with SMTP within 20mins! |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1011
|
Posted: Wed Apr 02, 2008 6:29 pm Post subject: |
|
|
If you're still interested in finding out what the problem was, you can retry it with my code snippet, but with a little correction:
It needs to be $mail_object->getMessage() instead of just $mail_object->getMessage. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|