summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-05-20 05:21:18 +0000
committeryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-05-20 05:21:18 +0000
commitefd7b4d8d0d58f92e8080ffe2da669bb451b622b (patch)
tree35cb7ed64c1c7baa3c0c8045c68dc2d01fbb4b51
parent7b06a0232e4dcb4be4a2b276f15f4a90903918b5 (diff)
downloadPost-SMTP-efd7b4d8d0d58f92e8080ffe2da669bb451b622b.zip
= 2.0.2 - 2019-05-19
* Fixed: Sendgrid code fix. * Fixed: Default method (nothing configured) will use the default mail on the server and not SMTP.
-rw-r--r--Postman/Postman-Mail/PostmanContactForm7.php2
-rw-r--r--Postman/Postman-Mail/PostmanModuleTransport.php5
-rw-r--r--Postman/Postman-Mail/PostmanSendGridMailEngine.php4
-rw-r--r--Postman/Postman-Mail/PostmanZendMailEngine.php4
-rw-r--r--Postman/Postman-Mail/Zend-1.12.10/Mail.php7
-rw-r--r--Postman/PostmanViewController.php2
-rw-r--r--postman-smtp.php4
-rw-r--r--readme.txt24
8 files changed, 31 insertions, 21 deletions
diff --git a/Postman/Postman-Mail/PostmanContactForm7.php b/Postman/Postman-Mail/PostmanContactForm7.php
index 64f4f5f..40fd698 100644
--- a/Postman/Postman-Mail/PostmanContactForm7.php
+++ b/Postman/Postman-Mail/PostmanContactForm7.php
@@ -13,7 +13,7 @@ class Postsmtp_ContactForm7 {
}
public function change_rest_response( $response ) {
- if ( $response['status'] == 'mail_failed' ) {
+ if ( array_key_exists('status', $response) && $response['status'] == 'mail_failed' ) {
$message = $this->result_error ['exception']->getMessage();
if ( ! $message || $message == '' ) {
diff --git a/Postman/Postman-Mail/PostmanModuleTransport.php b/Postman/Postman-Mail/PostmanModuleTransport.php
index 1dcc8b0..37d692d 100644
--- a/Postman/Postman-Mail/PostmanModuleTransport.php
+++ b/Postman/Postman-Mail/PostmanModuleTransport.php
@@ -503,6 +503,11 @@ abstract class PostmanAbstractZendModuleTransport extends PostmanAbstractModuleT
$deliveryDetails ['transport_name'] = $this->getTransportDescription ( $this->getSecurityType () );
$deliveryDetails ['host'] = $this->getHostname () . ':' . $this->getPort ();
$deliveryDetails ['auth_desc'] = $this->getAuthenticationDescription ( $this->getAuthenticationType () );
+
+ if ( $deliveryDetails ['host'] == 'localhost:25' ) {
+ $deliveryDetails ['transport_name'] = __( 'Sendmail (server defualt - not SMTP)', 'post-smtp');
+ }
+
/* translators: where (1) is the transport type, (2) is the host, and (3) is the Authentication Type (e.g. Postman will send mail via smtp.gmail.com:465 using OAuth 2.0 authentication.) */
return sprintf ( __ ( 'Postman will send mail via %1$s to %2$s using %3$s authentication.', 'post-smtp' ), '<b>' . $deliveryDetails ['transport_name'] . '</b>', '<b>' . $deliveryDetails ['host'] . '</b>', '<b>' . $deliveryDetails ['auth_desc'] . '</b>' );
}
diff --git a/Postman/Postman-Mail/PostmanSendGridMailEngine.php b/Postman/Postman-Mail/PostmanSendGridMailEngine.php
index b3e13b9..311d7cc 100644
--- a/Postman/Postman-Mail/PostmanSendGridMailEngine.php
+++ b/Postman/Postman-Mail/PostmanSendGridMailEngine.php
@@ -117,7 +117,7 @@ if ( ! class_exists( 'PostmanSendGridMailEngine' ) ) {
$bccEmails = array();
foreach ( ( array ) $message->getBccRecipients() as $recipient ) {
$recipient->log($this->logger, 'Bcc');
- $bccEmails[] = new \SendGrid\Mail\Cc( $recipient->getEmail(), $recipient->getName() );
+ $bccEmails[] = new \SendGrid\Mail\Bcc( $recipient->getEmail(), $recipient->getName() );
}
$email->addBccs($bccEmails);
@@ -166,7 +166,7 @@ if ( ! class_exists( 'PostmanSendGridMailEngine' ) ) {
if ( isset( $response_body->errors[0]->message ) || ! $email_sent ) {
- $e = ! $email_sent ? $this->errorCodesMap($response_code) : $response_body->errors[0]->message;
+ $e = ! isset( $response_body->errors[0]->message ) ? $this->errorCodesMap($response_code) : $response_body->errors[0]->message;
$this->transcript = $e;
$this->transcript .= PostmanModuleTransport::RAW_MESSAGE_FOLLOWS;
$this->transcript .= print_r( $email, true );
diff --git a/Postman/Postman-Mail/PostmanZendMailEngine.php b/Postman/Postman-Mail/PostmanZendMailEngine.php
index e4ea286..86905f8 100644
--- a/Postman/Postman-Mail/PostmanZendMailEngine.php
+++ b/Postman/Postman-Mail/PostmanZendMailEngine.php
@@ -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 ) );
}
diff --git a/Postman/Postman-Mail/Zend-1.12.10/Mail.php b/Postman/Postman-Mail/Zend-1.12.10/Mail.php
index d597ea7..67ba4b9 100644
--- a/Postman/Postman-Mail/Zend-1.12.10/Mail.php
+++ b/Postman/Postman-Mail/Zend-1.12.10/Mail.php
@@ -1175,10 +1175,9 @@ class Postman_Zend_Mail extends Postman_Zend_Mime_Message
{
if ($transport === null) {
if (! self::$_defaultTransport instanceof Postman_Zend_Mail_Transport_Abstract) {
- require_once 'Zend/Mail/Transport/Sendmail.php';
-
- $replyTo = self::getDefaultReplyTo();
- $transport = new Postman_Zend_Mail_Transport_Sendmail("-f{$replyTo['email']}");
+ require_once 'Mail/Transport/Sendmail.php';
+
+ $transport = new Postman_Zend_Mail_Transport_Sendmail("-f{$this->_from}");
} else {
$transport = self::$_defaultTransport;
}
diff --git a/Postman/PostmanViewController.php b/Postman/PostmanViewController.php
index 8dffa31..55a56e9 100644
--- a/Postman/PostmanViewController.php
+++ b/Postman/PostmanViewController.php
@@ -320,7 +320,7 @@ if ( ! class_exists( 'PostmanViewController' ) ) {
echo '
<div class="updated settings-error notice is-dismissible">
<p>
- <strong>Version ' . $version . ' Mailer Type:</strong> <a target="_blank" href="https://postmansmtp.com/post-smtp-2-0-mailer-type-and-much-more/">Read Here</a>
+ <strong>Version ' . $version . ' Sendgrid code fix and default delivery changes:</strong> <a target="_blank" href="https://postmansmtp.com/post-smtp-2-0-2-sendgrid-code-revert/">Read Here</a>
</p>
<button style="z-index: 100;" data-version="'. $version . '" data-security="' . wp_create_nonce('postsmtp') .'" type="button" class="notice-dismiss postman-release-message">
<span class="screen-reader-text">Dismiss this notice.</span>
diff --git a/postman-smtp.php b/postman-smtp.php
index 2413bbd..3919867 100644
--- a/postman-smtp.php
+++ b/postman-smtp.php
@@ -3,7 +3,7 @@
* Plugin Name: Post SMTP
* Plugin URI: https://wordpress.org/plugins/post-smtp/
* Description: Email not reliable? Post SMTP is the first and only WordPress SMTP plugin to implement OAuth 2.0 for Gmail, Hotmail and Yahoo Mail. Setup is a breeze with the Configuration Wizard and integrated Port Tester. Enjoy worry-free delivery even if your password changes!
- * Version: 2.0.1
+ * Version: 2.0.2
* Author: Yehuda Hassine
* Text Domain: post-smtp
* Author URI: https://postmansmtp.com
@@ -41,7 +41,7 @@
define( 'POST_BASE', __FILE__ );
define( 'POST_PATH', __DIR__ );
define( 'POST_URL', plugins_url('', POST_BASE ) );
-define( 'POST_SMTP_VER', '2.0.1' );
+define( 'POST_SMTP_VER', '2.0.2' );
$postman_smtp_exist = in_array( 'postman-smtp/postman-smtp.php', (array) get_option( 'active_plugins', array() ) );
$required_php_version = version_compare( PHP_VERSION, '5.6.0', '<' );
diff --git a/readme.txt b/readme.txt
index 104855d..3a353da 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=yehuda@m
Tags: postman smtp, postman, smtp, email, mail, mailer, email log, oauth2, gmail, google apps, hotmail, yahoo, mandrill api, sendgrid api, elastic email, office365, mailgun
Requires at least: 3.9
Tested up to: 5.2
-Stable tag: 2.0.1
+Stable tag: 2.0.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -12,10 +12,10 @@ Send, log and troubleshoot your Outgoing Email easily. Supports everything: SMTP
== Description ==
-= Version 2.0 released - Mailer Type =
-[Read the detailes here](https://postmansmtp.com/post-smtp-2-0-mailer-type-and-much-more/)
+= Version 2.0.2 released - Sendgrid code fix and default delivery changes =
+[Read the detailes here](https://postmansmtp.com/post-smtp-2-0-2-sendgrid-code-fix/)
-= The Only SMTP plugin with chrome Notifications =
+= The Only SMTP plugin with chrome Notifications =
Get notified if your emails are failing inside your Chrome browser. [Download here](https://chrome.google.com/webstore/detail/post-smtp-notifications/npklmbkpbknkmbohdbpikeidiaekjoch?hl=en-US)
= WordPress Mail SMTP Plugin =
@@ -97,7 +97,7 @@ Post SMTP (aka Postman SMTP) plugin was originally created by Jason Hendriks.
== Installation ==
> To send email reliably, you must use the SMTP server assigned to that email. If Post is unable to connect to the right SMTP server, you may have to ask your host to open the ports, or create a new email account managed by your host, or switch hosts!
->
+>
> The Connectivity Test utility will tell you which ports are open and the actions available to you.
= Easy install and setup! (Recommended for all users) =
@@ -118,7 +118,7 @@ Post SMTP (aka Postman SMTP) plugin was originally created by Jason Hendriks.
1. In 'Envelope From Address' enter your email address. This MUST be the same address you login to webmail with.
1. In 'Message From Address' enter your email address. Or this can be an alias, mailing list, or group email if you wish.
1. Choose the Save Changes button.
-1. Send yourself a test email.
+1. Send yourself a test email.
= To manually configure OAuth 2.0 Authentication (Advanced users only) =
@@ -135,13 +135,13 @@ Post SMTP (aka Postman SMTP) plugin was originally created by Jason Hendriks.
1. In 'Message From Address' enter your email address. Or this can be an alias, mailing list, or group email if you wish.
1. Choose the Save Changes button.
1. Choose the 'Request OAuth2 Permission' link and follow the instructions.
-1. Send yourself a test email.
+1. Send yourself a test email.
> Post is developed on OS X with PHP 5.5.14 and Apache 2.4.9. Post is tested in a [Red Hat OpenShift](http://www.openshift.com/) environment with PHP 5.3.3 and Apache 2.2.15 with Gmail, Hotmail and Yahoo Mail (US). Post is tested with [mailtrap.io](http://mailtrap.io).
-== Frequently Asked Questions ==
+== Frequently Asked Questions ==
= Where is Postman SMTP? =
From 2015-11-08 more or less I can say that Jason the original author stoped maintain the plugin.
@@ -200,7 +200,7 @@ Go to [Configure Post SMTP with Gmail\Gsuite OAuth](https://postmansmtp.com/how-
= How can I revoke Post's OAuth 2.0 access? =
* If you have a Google Account, from the [Google Developer's Console](https://www.google.com/accounts/Logout?continue=https://console.developers.google.com) use the Delete button under the Client ID.
* If you have a Microsoft Live account, from the [Microsoft account Developer Center](https://account.live.com/developers/applications/index), select the Application and choose Delete Application.
-* If you have a Yahoo Account, from the [Yahoo Developer Network My Apps](https://developer.yahoo.com/apps/), select the Application and choose Delete App.
+* If you have a Yahoo Account, from the [Yahoo Developer Network My Apps](https://developer.yahoo.com/apps/), select the Application and choose Delete App.
@@ -274,7 +274,7 @@ To avoid being flagged as spam, you need to prove your email isn't forged. On a
1. WordPress Dashboard showing both the Post widget and At a Glance widget
1. Main Settings screen - shows Main Menu and current status (new installation)
1. Setup Wizard (step 1) - Import data from other plugins
-1. Setup Wizard (step 4) - Connectivity Test
+1. Setup Wizard (step 4) - Connectivity Test
1. Manual Configuration - Account Settings: Password Authentication
1. Manual Configuration - Account Settings: OAuth 2.0 Authentication
1. Manual Configuration - Message Settings
@@ -289,6 +289,10 @@ To avoid being flagged as spam, you need to prove your email isn't forged. On a
== Changelog ==
+= 2.0.2 - 2019-05-19
+* Fixed: Sendgrid code fix.
+* Fixed: Default method (nothing configured) will use the default mail on the server and not SMTP.
+
= 2.0.1 - 2019-05-15
* New: Mailer Type - Added an option to send without overwrite the 'wp_mail' function, better compability to WordPress delivery. hopefully will be the default in the future.
* Updated: Sendgrid API was upgraded and rewritten to the new version.