Skip to content

Instantly share code, notes, and snippets.

@renan
Created June 11, 2013 14:46
Show Gist options
  • Select an option

  • Save renan/5757456 to your computer and use it in GitHub Desktop.

Select an option

Save renan/5757456 to your computer and use it in GitHub Desktop.
diff --git a/lib/Cake/Network/Email/SmtpTransport.php b/lib/Cake/Network/Email/SmtpTransport.php
index 363e477..ec48d6c 100644
--- a/lib/Cake/Network/Email/SmtpTransport.php
+++ b/lib/Cake/Network/Email/SmtpTransport.php
@@ -145,7 +145,10 @@ class SmtpTransport extends AbstractTransport {
* @throws SocketException
*/
protected function _sendRcpt() {
- $from = $this->_cakeEmail->from();
+ $from = $this->_cakeEmail->returnPath();
+ if (empty($from)) {
+ $from = $this->_cakeEmail->from();
+ }
$this->_smtpSend('MAIL FROM:<' . key($from) . '>');
$to = $this->_cakeEmail->to();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment