summaryrefslogtreecommitdiff
path: root/program/lib
diff options
context:
space:
mode:
Diffstat (limited to 'program/lib')
-rw-r--r--program/lib/Net/SMTP.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/program/lib/Net/SMTP.php b/program/lib/Net/SMTP.php
index 9b835d723..6df13a029 100644
--- a/program/lib/Net/SMTP.php
+++ b/program/lib/Net/SMTP.php
@@ -226,9 +226,10 @@ class Net_SMTP
{
$this->_debug("Send: $data");
- if (PEAR::isError($error = $this->_socket->write($data))) {
- return PEAR::raiseError('Failed to write to socket: ' .
- $error->getMessage());
+ $error = $this->_socket->write($data);
+ if ($error === false || PEAR::isError($error)) {
+ $msg = ($error) ? $error->getMessage() : "unknown error";
+ return PEAR::raiseError("Failed to write to socket: $msg");
}
return true;