|
|
@@ -295,7 +295,7 @@ class CakeEmail {
|
|
|
if ($email === null) {
|
|
|
return $this->_from;
|
|
|
}
|
|
|
- return $this->_setEmailSingle('_from', $email, $name, __d('cake', 'From requires only 1 email address.'));
|
|
|
+ return $this->_setEmailSingle('_from', $email, $name, __d('cake_dev', 'From requires only 1 email address.'));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -310,7 +310,7 @@ class CakeEmail {
|
|
|
if ($email === null) {
|
|
|
return $this->_sender;
|
|
|
}
|
|
|
- return $this->_setEmailSingle('_sender', $email, $name, __d('cake', 'Sender requires only 1 email address.'));
|
|
|
+ return $this->_setEmailSingle('_sender', $email, $name, __d('cake_dev', 'Sender requires only 1 email address.'));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -325,7 +325,7 @@ class CakeEmail {
|
|
|
if ($email === null) {
|
|
|
return $this->_replyTo;
|
|
|
}
|
|
|
- return $this->_setEmailSingle('_replyTo', $email, $name, __d('cake', 'Reply-To requires only 1 email address.'));
|
|
|
+ return $this->_setEmailSingle('_replyTo', $email, $name, __d('cake_dev', 'Reply-To requires only 1 email address.'));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -340,7 +340,7 @@ class CakeEmail {
|
|
|
if ($email === null) {
|
|
|
return $this->_readReceipt;
|
|
|
}
|
|
|
- return $this->_setEmailSingle('_readReceipt', $email, $name, __d('cake', 'Disposition-Notification-To requires only 1 email address.'));
|
|
|
+ return $this->_setEmailSingle('_readReceipt', $email, $name, __d('cake_dev', 'Disposition-Notification-To requires only 1 email address.'));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -355,7 +355,7 @@ class CakeEmail {
|
|
|
if ($email === null) {
|
|
|
return $this->_returnPath;
|
|
|
}
|
|
|
- return $this->_setEmailSingle('_returnPath', $email, $name, __d('cake', 'Return-Path requires only 1 email address.'));
|
|
|
+ return $this->_setEmailSingle('_returnPath', $email, $name, __d('cake_dev', 'Return-Path requires only 1 email address.'));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -445,7 +445,7 @@ class CakeEmail {
|
|
|
protected function _setEmail($varName, $email, $name) {
|
|
|
if (!is_array($email)) {
|
|
|
if (!Validation::email($email)) {
|
|
|
- throw new SocketException(__d('cake', 'Invalid email: "%s"', $email));
|
|
|
+ throw new SocketException(__d('cake_dev', 'Invalid email: "%s"', $email));
|
|
|
}
|
|
|
if ($name === null) {
|
|
|
$name = $email;
|
|
|
@@ -459,7 +459,7 @@ class CakeEmail {
|
|
|
$key = $value;
|
|
|
}
|
|
|
if (!Validation::email($key)) {
|
|
|
- throw new SocketException(__d('cake', 'Invalid email: "%s"', $key));
|
|
|
+ throw new SocketException(__d('cake_dev', 'Invalid email: "%s"', $key));
|
|
|
}
|
|
|
$list[$key] = $value;
|
|
|
}
|
|
|
@@ -499,7 +499,7 @@ class CakeEmail {
|
|
|
protected function _addEmail($varName, $email, $name) {
|
|
|
if (!is_array($email)) {
|
|
|
if (!Validation::email($email)) {
|
|
|
- throw new SocketException(__d('cake', 'Invalid email: "%s"', $email));
|
|
|
+ throw new SocketException(__d('cake_dev', 'Invalid email: "%s"', $email));
|
|
|
}
|
|
|
if ($name === null) {
|
|
|
$name = $email;
|
|
|
@@ -513,7 +513,7 @@ class CakeEmail {
|
|
|
$key = $value;
|
|
|
}
|
|
|
if (!Validation::email($key)) {
|
|
|
- throw new SocketException(__d('cake', 'Invalid email: "%s"', $key));
|
|
|
+ throw new SocketException(__d('cake_dev', 'Invalid email: "%s"', $key));
|
|
|
}
|
|
|
$list[$key] = $value;
|
|
|
}
|
|
|
@@ -544,7 +544,7 @@ class CakeEmail {
|
|
|
*/
|
|
|
public function setHeaders($headers) {
|
|
|
if (!is_array($headers)) {
|
|
|
- throw new SocketException(__d('cake', '$headers should be an array.'));
|
|
|
+ throw new SocketException(__d('cake_dev', '$headers should be an array.'));
|
|
|
}
|
|
|
$this->_headers = $headers;
|
|
|
return $this;
|
|
|
@@ -559,7 +559,7 @@ class CakeEmail {
|
|
|
*/
|
|
|
public function addHeaders($headers) {
|
|
|
if (!is_array($headers)) {
|
|
|
- throw new SocketException(__d('cake', '$headers should be an array.'));
|
|
|
+ throw new SocketException(__d('cake_dev', '$headers should be an array.'));
|
|
|
}
|
|
|
$this->_headers = array_merge($this->_headers, $headers);
|
|
|
return $this;
|
|
|
@@ -744,7 +744,7 @@ class CakeEmail {
|
|
|
return $this->_emailFormat;
|
|
|
}
|
|
|
if (!in_array($format, $this->_emailFormatAvailable)) {
|
|
|
- throw new SocketException(__d('cake', 'Format not available.'));
|
|
|
+ throw new SocketException(__d('cake_dev', 'Format not available.'));
|
|
|
}
|
|
|
$this->_emailFormat = $format;
|
|
|
return $this;
|
|
|
@@ -779,9 +779,9 @@ class CakeEmail {
|
|
|
$transportClassname .= 'Transport';
|
|
|
App::uses($transportClassname, $plugin . 'Network/Email');
|
|
|
if (!class_exists($transportClassname)) {
|
|
|
- throw new SocketException(__d('cake', 'Class "%s" not found.', $transportClassname));
|
|
|
+ throw new SocketException(__d('cake_dev', 'Class "%s" not found.', $transportClassname));
|
|
|
} elseif (!method_exists($transportClassname, 'send')) {
|
|
|
- throw new SocketException(__d('cake', 'The "%s" do not have send method.', $transportClassname));
|
|
|
+ throw new SocketException(__d('cake_dev', 'The "%s" do not have send method.', $transportClassname));
|
|
|
}
|
|
|
|
|
|
return $this->_transportClass = new $transportClassname();
|
|
|
@@ -802,7 +802,7 @@ class CakeEmail {
|
|
|
$this->_messageId = $message;
|
|
|
} else {
|
|
|
if (!preg_match('/^\<.+@.+\>$/', $message)) {
|
|
|
- throw new SocketException(__d('cake', 'Invalid format to Message-ID. The text should be something like "<uuid@server.com>"'));
|
|
|
+ throw new SocketException(__d('cake_dev', 'Invalid format to Message-ID. The text should be something like "<uuid@server.com>"'));
|
|
|
}
|
|
|
$this->_messageId = $message;
|
|
|
}
|
|
|
@@ -826,11 +826,11 @@ class CakeEmail {
|
|
|
$fileInfo = array('file' => $fileInfo);
|
|
|
}
|
|
|
if (!isset($fileInfo['file'])) {
|
|
|
- throw new SocketException(__d('cake', 'File not specified.'));
|
|
|
+ throw new SocketException(__d('cake_dev', 'File not specified.'));
|
|
|
}
|
|
|
$fileInfo['file'] = realpath($fileInfo['file']);
|
|
|
if ($fileInfo['file'] === false || !file_exists($fileInfo['file'])) {
|
|
|
- throw new SocketException(__d('cake', 'File not found: "%s"', $fileInfo['file']));
|
|
|
+ throw new SocketException(__d('cake_dev', 'File not found: "%s"', $fileInfo['file']));
|
|
|
}
|
|
|
if (is_int($name)) {
|
|
|
$name = basename($fileInfo['file']);
|
|
|
@@ -900,10 +900,10 @@ class CakeEmail {
|
|
|
*/
|
|
|
public function send($content = null) {
|
|
|
if (empty($this->_from)) {
|
|
|
- throw new SocketException(__d('cake', 'From is not specified.'));
|
|
|
+ throw new SocketException(__d('cake_dev', 'From is not specified.'));
|
|
|
}
|
|
|
if (empty($this->_to) && empty($this->_cc) && empty($this->_bcc)) {
|
|
|
- throw new SocketException(__d('cake', 'You need specify one destination on to, cc or bcc.'));
|
|
|
+ throw new SocketException(__d('cake_dev', 'You need specify one destination on to, cc or bcc.'));
|
|
|
}
|
|
|
|
|
|
if (is_array($content)) {
|
|
|
@@ -994,11 +994,11 @@ class CakeEmail {
|
|
|
protected function _applyConfig($config) {
|
|
|
if (is_string($config)) {
|
|
|
if (!class_exists('EmailConfig') && !config('email')) {
|
|
|
- throw new SocketException(__d('cake', '%s not found.', APP . 'Config' . DS . 'email.php'));
|
|
|
+ throw new SocketException(__d('cake_dev', '%s not found.', APP . 'Config' . DS . 'email.php'));
|
|
|
}
|
|
|
$configs = new EmailConfig();
|
|
|
if (!isset($configs->{$config})) {
|
|
|
- throw new SocketException(__d('cake', 'Unknown email configuration "%s".', $config));
|
|
|
+ throw new SocketException(__d('cake_dev', 'Unknown email configuration "%s".', $config));
|
|
|
}
|
|
|
$config = $configs->{$config};
|
|
|
}
|