Hello,

I am new to Zend Framework.

I tried to send an e-mail using Zend_Mail. I used your example [1], here's
my code:

<?php
require_once('Zend/Mail.php');

// Set-up transporter
$tr = new Zend_Mail_Transport_Sendmail('[EMAIL PROTECTED]');

$mail = new Zend_Mail();
$mail->setBodyText('This is the text of the mail.');
$mail->setFrom('[EMAIL PROTECTED]', 'Some Sender');
$mail->addTo('[EMAIL PROTECTED]', 'Some Recipient');
$mail->setSubject('TestSubject');
$mail->send($tr);
?>

Running this script will end in this error message:

Fatal error: Class 'Zend_Mail_Transport_Sendmail' not found in
/data/www/testweb/public_html/zendmail-test.php on line 4

When I add the line

require_once('Zend/Mail/Transport/Sendmail.php');

before the "new Zend_Mail_Transport_Sendmail" call, everything is working.

And that's the question:
Is that a wanted behavior/design?

I am new to Zend Framework, I would expect that it should be enough to just
include "Zend/Mail.php".

Also in line 723 in "Zend/Mail.php" there is a include... but it's too late.

Actual I don't understand, why you didn't include it with the other files in
line 26-41.


See also:
=========
[1] http://framework.zend.com/manual/en/zend.mail.html


-- 
Regards,
Thomas


Reply via email to