ZF-8493: Zend_Mail_Transport_Sendmail creates warning if it doesnt exist instead of throwing an exception
Description
The _sendMail() function doesnt check if mail() is actually available. When I run it on my local XAMPP installation I don't have the mail-function available and it will return an error about that. If the mail would have the error surpressed I will get an exception. So, please place @'s before the mail() functions so I can catch the exception without getting extra errors/warnings. Simple fix I guess :)
Comments
Posted by Satoru Yoshida (satoruyoshida) on 2009-12-14T02:35:09.000+0000
Hi, R Slootjes.
In substitution for @ mark, could it also match Your purpose like as following code ?
Posted by R Slootjes (rslootjes) on 2009-12-14T04:33:13.000+0000
That won't be sufficient since this:
var_dump(function_exists('mail'));
displays
bool(true).
The function exists but it's just not configured to work (i guess).
Posted by Satoru Yoshida (satoruyoshida) on 2009-12-14T06:05:29.000+0000
Thank You for responce, R Slootjes. Then I will be happy if you would try the following code.
Posted by R Slootjes (rslootjes) on 2009-12-16T03:28:39.000+0000
I will try to test this today, i just got some tight deadlines ;)
Posted by R Slootjes (rslootjes) on 2009-12-17T01:21:25.000+0000
This seems to be working like it should:
Test'); $objMail->setFrom('robert@sender.com', 'Robert'); $objMail->addTo('robert@receiver.com', 'Robert'); $objMail->setSubject('Testmail'); $objMail->send(); } catch(Exception $objException) { echo 'exception: ' . $objException->getMessage(); }returns:
Posted by Satoru Yoshida (satoruyoshida) on 2009-12-17T07:20:26.000+0000
Thank You for cooperation, R Slootjes ;-) I reflected it at SVN trunk r19712.
Posted by Satoru Yoshida (satoruyoshida) on 2009-12-24T02:25:32.000+0000
change to next mini. SVN r19915 in 1.9 branch