On Jun 3, 2011, at 12:48 PM, whisher wrote:

> David Muir wrote:
>> 
>> You can't be getting the same error because the SMTP transport will not
>> throw the same exception. The only exception that the SMTP transport
>> throws is '_prepareHeaders requires a registered Zend_Mail object'. Is
>> that what you're getting?
>> 
>> David
>> 
> 
> $body = 'Hi all,Alan';
> $mail = new Zend_Mail();
> $mail->setFrom('[email protected]', 'Alan');
> $mail->addTo('[email protected]', 'Alan');
> $mail->addCc(array('human_readable1'=>'[email protected]','human_readable2'=>'[email protected]'));
> 
> $mail->setSubject('Basketball practice this week');
> $mail->setBodyText($body);
> 
$tr1 = new Zend_Mail_Transport_Smtp('[email protected]');
$mail->send($tr1);

...to use the SMTP transport and get the other error message.
http://framework.zend.com/manual/en/zend.mail.different-transports.html

you can also do it like it is explained here, by replacing the default transport
http://framework.zend.com/manual/en/zend.mail.sending.html

When I used zend_mail the first time, I first ensured the box can send mail 
[from the console]. Then checked the mta im using from the console is the same 
one php is set to use `php -i|grep -i mail`. Do an ls -l on the sendmail binary 
this php is configured to use to find the mta your using if your unsure, you'll 
have to follow a few links before you get to the end of the trail. If either 
method to use Zend_Mail does not work and the exception does not seem to give 
any hints, check your mail logs. I setup postfix as a gmail relay, the local 
server is set to relay any locally queued mail as that gmail user. The messages 
that are queued are delivered to gmail via local SMTP relay.

"It is essentially a wrapper to the PHP ยป mail() function." 
http://framework.zend.com/manual/en/zend.mail.introduction.html#zend.mail.introduction.sendmail
look here http://php.net/manual/en/function.mail.php and maybe just try: $ php 
-r "mail('[email protected]', 'Test Subject', 'Test message');"
then tail your maillog

Good luck

F
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to