php - "Your message has been successfully sent using the following protocol: mail",但我什么也没得到

标签 php apache codeigniter xampp

我使用 Xampp,并且想使用 CodeIgniter 发送电子邮件。如果使用 smtp 会出现错误:

Message: fsockopen(): unable to connect to ssl://smtp.googlemail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) Filename: libraries/Email.php

$config = Array(
    'protocol' => 'smtp',
    'smtp_host' => 'ssl://smtp.googlemail.com',
    'smtp_port' => 465,
    'smtp_user' => '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c4a3a9a5ada884a3a9a5ada8eaa7aba9" rel="noreferrer noopener nofollow">[email protected]</a>',
    'smtp_pass' => 'your_password'
);

$this->load->library('email', $config);
$this->email->set_newline("\r\n");   
$this->email->from('<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b7ced8c2c5f7d2cfd6dac7dbd299d4d8da" rel="noreferrer noopener nofollow">[email protected]</a>', 'Your Name');
$this->email->to('(here I put my mail)@yahoo.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
echo $this->email->print_debugger();

(line extension=php_openssl.dll is decomented)

使用这些设置:

$this->load->library('email');
$this->email->set_newline("\r\n");   
$this->email->from('<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="166f79636456736e777b667a733875797b" rel="noreferrer noopener nofollow">[email protected]</a>', 'Your Name');
$this->email->to('(here I put my mail)@yahoo.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
echo $this->email->print_debugger();

出现消息:您的消息已使用以下协议(protocol)成功发送:邮件

出自:《你的名字》 返回路径:......

但我没有收到任何邮件。

问题是什么?

最佳答案

  1. “邮件”协议(protocol)意味着它使用 PHP 的 mail()简单地提交到服务器的邮件代理的功能。 “成功”仅仅意味着它被接受,但并不表明它是否曾经尝试过交付。邮件代理可能已关闭、配置错误等。您需要检查邮件日志,或者更有可能询问您的托管提供商。
  2. 如果您实际上使用 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b7d6d9cec3dfded9d0f7d2cfd6dac7dbd299d4d8da" rel="noreferrer noopener nofollow">[email protected]</a> 的“发件人”地址我怀疑这封邮件是否真的能够通过。使用可以接收电子邮件的真实电子邮件地址。
  3. 检查您的垃圾邮件文件夹。

关于php - "Your message has been successfully sent using the following protocol: mail",但我什么也没得到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15030783/

相关文章:

PHP 性能指标

php - CURLOPT_POSTFIELDS 的 curl POST 格式

java - Apache Tomcat 执行 Java 类

php - fatal error : Allowed Memory Size of 134217728 Bytes Exhausted (CodeIgniter + XML-RPC)

php - 在sql中使用lat和long查找距离

php - 拉维尔 4.2 : Copying database records from one database to another

php - 在 Codeigniter 中创建 Cookie

android - Eclipse - 无法完成安装,因为找不到一个或多个必需项 (org.apache.httpcomponents.httpclient)

python - 使用当前ec2公共(public)IP配置apache虚拟主机

php - 从 3 个不同的表中获取最近的帖子,在 codeigniter 中将结果限制为 5 个