0

我有一个脚本,它引起了一些问题。但在此之前,我想说明关于我的服务器的文件结构。

如果我直接在www文件夹下上传我的脚本,那么没有问题。ecommerce但是,如果我在我的文件夹下创建一个名为的www文件夹,然后放置脚本,那么它就会引发问题。

假设我创建了一个文件夹www/ecommerce,邮件有问题。

这是我的脚本

$this->load->library('email');
            $config['charset'] = 'utf-8';
            $config['wordwrap'] = TRUE;
            $config['mailtype'] = 'html';
            $config['protocol'] = 'sendmail';
            $this->email->initialize($config);
            $this->email->from('info@divinotech.com', 'Divinotech Support');
            $this->email->to($email);
            $this->email->subject('Welcome To SaiBoutique');
            $msg="<div align='center' style='background-color: #cfcfcf; width: 400ox; height: 300px;'><strong>You Have Been Successfuly registered to SaiBoutique.com. Please Visit Our Site To Have Fabulous Offer</strong>
                  <br/>
                  <br/>
                  <a href='".base_url()."user/activate_account/".$activation_key."'><strong>Click Here To Activate Your Account</strong></a></div>";
            $this->email->message($msg);
            if($this->email->send())
                echo "Successfully Registered' Please Log-In.Mail Send To Your Email-ID";

我在控制器中写这个。

我需要保留它,www/ecommerce以便我的项目链接如下所示:

http://divinotech.com/ecommerce

这是错误代码

Exit status code: 127
Unable to open a socket to Sendmail. Please check settings.
Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method.
User-Agent: CodeIgniter
4

1 回答 1

0

(1) 如果您使用共享主机,大多数共享主机公司出于安全目的禁用“sendmail”。请与您的托管服务提供商联系以了解“sendmail”。

(2) 如果您使用的是 VPS 或专用服务器,那么您可以在服务器管理员的帮助下检查“sendmail”在您的服务器中是否正常工作。

(3) 其他直接的解决方案是使用 SMTP 发送邮件。

于 2013-05-30T11:27:39.713 回答