PHP   发布时间:2022-04-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了php-发送的CodeIgniter奇怪的电子邮件大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

我有一个函数,可以传递参数以轻松发送电子邮件.

就是这个 :

function __construct() {
        $this -> CI = get_instance();
        $this -> CI -> load -> library('email');
    }

    public function send_one_email($single_email, $single_subject, $single_body, $single_attach) {
        $this -> CI -> email -> clear();
        $this -> CI -> email -> to($single_email);
        $this -> CI -> email -> from('**************');
        $this -> CI -> email -> subject($single_subject);
        $this -> CI -> email -> message($single_body);

        if ($single_attach) {
            $this -> CI -> email -> attachment($single_attach);
        }

        if ($this -> CI -> email -> send()) {
            return TRUE;
        }
    }

我收到的电子邮件是(我不应该收到):

这是地狱吗?

这是我在email.PHP中的配置:

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 $config['protocol'] = 'smtp';
 $config['smtp_host'] = 'ssl://smtp.googlemail.com';
 $config['smtp_user'] = '********************@gmail.com';
 $config['smtp_pass'] = '**************************';
 $config['smtp_port'] = 465;
 $config['smtp_timeout'] = 30;
 $config['charset'] = 'utf-8';
 $config['crlf'] = "\r\n";
 $config['newline'] = "\r\n";
 $config['wordwrap'] = TRUE;
 $config['mailtype'] = 'html';

我在另一个应用程序中使用了相同的脚本,但我从未得到过.任何帮助都会很棒.

解决方法:

电子邮件顶部的消息似乎是从主题标头开始的,因此我想这将是开始调试的好地方.

曾经有一个issue caused by Subject lines with more than 75 chars.

如果上述修复方法无效,则开发人员已修补Email.PHP解决此问题:

https://github.com/EllisLab/CodeIgniter/issues/1409#issuecomment-9330713

大佬总结

以上是大佬教程为你收集整理的php-发送的CodeIgniter奇怪的电子邮件全部内容,希望文章能够帮你解决php-发送的CodeIgniter奇怪的电子邮件所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: