0
이 기능은 여전히 작동하지만 E_ALL 오류보고 기능이 켜져 있고 메일 기능으로 여러 전자 메일 요청을 보내면 정확하게 알려지지 않은 버그이므로이 통지를 받으면 해결할만한 문제가 있는지 확실하지 않습니다. 아닙니다.PHP 메일 SMTP 버그?
Notice: Only variable references should be returned by reference in /usr/share/pear/Mail/mime.php
Google에 오류가 발생하면 이전에 해결되었거나 오래 되었어야하는 버그로보고됩니다. 나는이 중요한 확실하지 않다, 그러나 이것은 이메일 요청이 너무 전송되는 기능입니다 :
public static function sendEMailSMTP($args = array()) {
if(self::_hasAdapter(get_class(), __FUNCTION__))
return self::_callAdapter(get_class(), __FUNCTION__, $args);
$args += self::getEmailDefaults();
$args = self::_applyFilter(get_class(), __FUNCTION__ , $args , array('event'=>'args'));
if(is_array($args)){
extract($args);
$config=pv_getSiteEmailConfiguration();
if(empty($smtp_username)){
$smtp_username=$config['smtp_username'];
}
if(empty($smtp_password)){
$smtp_password=$config['smtp_password'];
}
if(empty($smtp_host)){
$smtp_host=$config['smtp_host'];
}
if(empty($smtp_port)){
$smtp_port=$config['smtp_port'];
}
require_once "Mail.php";
require_once 'Mail/mime.php';
$stmp_info= array (
'host' => $smtp_host,
'port' => $smtp_port,
'auth' => true,
'username' => $smtp_username,
'password' => $smtp_password
);
$headers = array (
'From' => $sender,
'To' => $receiver,
'Subject' => $subject
);
if(!empty($args['carboncopy'])){
$headers['Cc']=$args['carboncopy'];
$receiver.=','.$args['carboncopy'];
}
if(!empty($args['blindcopy'])){
$headers['Bcc']=$args['blindcopy'];
$receiver.=','.$args['blindcopy'];
}
if(!empty($args['reply_to'])){
$headers['Reply-To']=$args['reply_to'];
}
if(!empty($args['return_path'])){
$headers['Return-Path']=$args['return_path'];
}
if(!empty($args['errors_to'])){
$headers['Errors-To']=$args['errors_to'];
}
if(!empty($args['message_id'])){
$headers['Message-ID']=$args['message_id'];
}
if(empty($text_message)){
$text = strip_tags($message);
} else {
$text = $text_message;
}
if(empty($html_message)){
$html = $message;
} else {
$html= $html_message;
}
$mime = new Mail_mime("\n");
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
if(!empty($attachment)){
if(is_array($attachment)) {
foreach($attachment as $file) {
if(file_exists($file))
$mime->addAttachment($file , PVFileManager::getFileMimeType($file));
}//end foreach
} else {
$mime->addAttachment($attachment, PVFileManager::getFileMimeType($attachment));
}
}
$body = $mime->get();
$headers = $mime->headers($headers);
$smtp = Mail::factory('smtp', $stmp_info);
$mail = $smtp->send($receiver, $headers, $body);
self::_notify(get_class().'::'.__FUNCTION__, $args);
}
}//end sendEmailPHPSMTP