Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Codeigniter PHPMailer电子邮件未发送到office 365帐户_Codeigniter_Email_Phpmailer_Office365 - Fatal编程技术网

Codeigniter PHPMailer电子邮件未发送到office 365帐户

Codeigniter PHPMailer电子邮件未发送到office 365帐户,codeigniter,email,phpmailer,office365,Codeigniter,Email,Phpmailer,Office365,我在Codeigniter中使用php邮件程序。 这是我的电子邮件设置 邮件正在发送到其他电子邮件id,但未发送到office 365中的电子邮件id <?php defined('BASEPATH') OR exit('No direct script access allowed.'); $config['useragent'] = 'PHPMailer'; // Mail engine switcher: 'CodeIgniter' or

我在Codeigniter中使用php邮件程序。 这是我的电子邮件设置 邮件正在发送到其他电子邮件id,但未发送到office 365中的电子邮件id

 <?php defined('BASEPATH') OR exit('No direct script access allowed.');

$config['useragent']        = 'PHPMailer';              // Mail engine switcher: 'CodeIgniter' or 'PHPMailer'
$config['protocol']         = 'smtp';                   // 'mail', 'sendmail', or 'smtp'
$config['mailpath']         = '/usr/sbin/sendmail';
$config['smtp_host']        = 'smtp.office365.com';
$config['smtp_user']        = 'example@example.com';
$config['smtp_pass']        = 'password';
//$config['smtp_port']        = 587;
$config['smtp_timeout']     = 5;                        // (in seconds)
$config['smtp_crypto']      = 'tls';                       // '' or 'tls' or 'ssl'
$config['smtp_debug']       = 4;                        // PHPMailer's SMTP debug info level: 0 = off, 1 = commands, 2 = commands and data, 3 = as 2 plus connection status, 4 = low level data output.
$config['wordwrap']         = true;
$config['wrapchars']        = 76;
$config['mailtype']         = 'html';                   // 'text' or 'html'
$config['charset']          = 'ISO-8859-15';                     // 'UTF-8', 'ISO-8859-15', ...; NULL (preferable) means config_item('charset'), i.e. the character set of the site.
$config['validate']         = true;
$config['priority']         = 3;                        // 1, 2, 3, 4, 5; on PHPMailer useragent NULL is a possible option, it means that X-priority header is not set at all, see https://github.com/PHPMailer/PHPMailer/issues/449
$config['crlf']             = "\n";                     // "\r\n" or "\n" or "\r"
$config['newline']          = "\n";                     // "\r\n" or "\n" or "\r"
$config['bcc_batch_mode']   = false;
$config['bcc_batch_size']   = 200;
$config['encoding']         = '8bit';                   // The body encoding. For CodeIgniter: '8bit' or '7bit'. For PHPMailer: '8bit', '7bit', 'binary', 'base64', or 'quoted-printable'.
相同的设置在其他服务器中工作,但在Go daddy服务器中不工作。
我检查了openssl连接是否已启用。

这个问题有很多重复的地方,PHPMailer文档中也介绍了这一点:GoDaddy阻止出站电子邮件,因此您必须使用他们的邮件服务器。

可能重复的问题
  Connection: opening to smtp.office365.com:25, timeout=5, options=array ( ) 2016-01-02 10:00:49 SMTP ERROR: Failed to connect to server: Connection refused (111) 2016-01-02 10:00:49 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting bool(false)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting