summaryrefslogtreecommitdiff
path: root/Postman/Postman-Mail/PostmanZendMailEngine.php
diff options
context:
space:
mode:
authoryehuda <yehuda@myinbox.in>2019-05-16 12:15:39 +0300
committeryehuda <yehuda@myinbox.in>2019-05-16 12:15:39 +0300
commit6b0c4d5d97cac613ad8218fc9f0779eec63c28e3 (patch)
tree3ac2513ad5cb08650b03f55d837cf6b1d578dd21 /Postman/Postman-Mail/PostmanZendMailEngine.php
parentc88e7ad0b42cefd8fb7b509c8c2e355f567d9434 (diff)
parent09ad01149ef5981407149bc3c9502058482fb419 (diff)
downloadPost-SMTP-6b0c4d5d97cac613ad8218fc9f0779eec63c28e3.zip
Merge remote-tracking branch 'origin/dev'
Diffstat (limited to 'Postman/Postman-Mail/PostmanZendMailEngine.php')
-rw-r--r--Postman/Postman-Mail/PostmanZendMailEngine.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/Postman/Postman-Mail/PostmanZendMailEngine.php b/Postman/Postman-Mail/PostmanZendMailEngine.php
index 8d69811..86905f8 100644
--- a/Postman/Postman-Mail/PostmanZendMailEngine.php
+++ b/Postman/Postman-Mail/PostmanZendMailEngine.php
@@ -47,8 +47,8 @@ if ( ! class_exists( 'PostmanZendMailEngine' ) ) {
/**
*
- * @param unknown $senderEmail
- * @param unknown $accessToken
+ * @param mixed $senderEmail
+ * @param mixed $accessToken
*/
function __construct( PostmanZendModuleTransport $transport ) {
assert( isset( $transport ) );
@@ -171,10 +171,12 @@ if ( ! class_exists( 'PostmanZendMailEngine' ) ) {
$this->logger->debug( 'Create the Zend_Mail transport' );
$zendTransport = $this->transport->createZendMailTransport( $this->transport->getHostname(), array() );
+ $transport = $this->transport instanceof PostmanDefaultModuleTransport ? null : $zendTransport;
+
try {
// send the message
$this->logger->debug( 'Sending mail' );
- $mail->send( $zendTransport );
+ $mail->send( $transport );
if ( $this->logger->isInfo() ) {
$this->logger->info( sprintf( 'Message %d accepted for delivery', PostmanState::getInstance()->getSuccessfulDeliveries() + 1 ) );
}
@@ -204,7 +206,7 @@ if ( ! class_exists( 'PostmanZendMailEngine' ) ) {
$message = $e->getMessage();
if ( $e->getCode() == 334 ) {
// replace the unusable Google message with a better one in the case of code 334
- $message = sprintf( __( 'Communication Error [334] - make sure the Envelope From email is the same account used to create the Client ID.', Postman::TEXT_DOMAIN ) );
+ $message = sprintf( __( 'Communication Error [334] - make sure the Envelope From email is the same account used to create the Client ID.', 'post-smtp' ) );
}
// create a new exception
$newException = new Exception( $message, $e->getCode() );