当通过PHP脚本使用SMTP发送邮件时,每次将邮件自动保存到已配置邮箱的“已发送邮件”文件夹中。但是这里不需要通过PHP脚本使用SMTP发送邮件时进行保存。任何帮助,不胜感激!
我的PHP SMTP代码如下:-
<?php
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'smtp.office365.com';
$config['smtp_port'] = '25';
$config['smtp_port'] = '587';
$config['smtp_timeout'] = '7';
$config['smtp_crypto'] = 'tls';
$config['smtp_user'] = 'user@user.com';
$config['smtp_pass'] = 'password';
$config['charset'] = "utf-8";
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n";
$config['validation'] = TRUE;
$config['mailtype'] = 'html';
$cc_email = str_replace(';', ',', $mail_cc);
$this->email->cc($cc_email);
if (!empty($file)){
$this->email->attach($file);
}
$this->email->subject($_POST["subject"]);
$this->email->message($message);
$this->email->send();
?>