Код воспламенитель электронной почты

Здравствуйте, у меня есть проблема с кодом воспламенитель, отправьте здесь мой код

function __construct()
{
parent::__construct();
$this->load->library('email');}

function index()
{
$this->load->library('email');
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'smtp.mailtrap.io',
'smtp_port' => 2525,
'smtp_user' => 'edf81f6d31af91',
'smtp_pass' => '6d824154999158',
'crlf' => "\r\n",
'newline' => "\r\n");
$this->email->initialize($config);

$this->email->from('b8748b238c-54555a@inbox.mailtrap.io', 'Your Name');
$this->email->to('dadycool014@hotmail.com');$this->email->subject('Email Test');
$this->email->message('Testing the email class.');

$this->email->send();}

и когда я выполняю этот код, я получаю эту ошибку

Обнаружена ошибка PHP
Серьезность: Предупреждение

Сообщение: fsockopen ():

Имя файла: library / Email.php

Номер строки: 2055

Backtrace:

Файл: C: \ xampp \ htdocs \ ctmprod \ application \ library \ Email.php
Линия: 2055
Функция: fsockopen

Файл: C: \ xampp \ htdocs \ ctmprod \ application \ library \ Email.php
Линия: 1950
Функция: _smtp_connect

Файл: C: \ xampp \ htdocs \ ctmprod \ application \ library \ Email.php
Линия: 1825
Функция: _send_with_smtp

Файл: C: \ xampp \ htdocs \ ctmprod \ application \ library \ Email.php
Линия: 1715
Функция: _spool_email

Файл: C: \ xampp \ htdocs \ ctmprod \ application \ controllers \ email.php
Линия: 51
Функция: отправить

Файл: C: \ xampp \ htdocs \ ctmprod \ index.php
Линия: 315
Функция: require_once

1

Решение

function sesnd_mail()
{
$this->load->library('email');
$config = array();
$config['useragent'] = "CodeIgniter";
$config['mailpath']  = "/usr/bin/sendmail"; // or "/usr/sbin/sendmail"$config['protocol']  = "smtp";
$config['smtp_host'] = "smtp.sendgrid.net";
$config['smtp_user'] = "username";
$config['smtp_pass'] = "password ";
$config['smtp_port'] = "25";
$config['mailtype']  = 'html';
$config['charset']   = 'utf-8';
$config['newline']   = "\r\n";
$config['wordwrap']  = TRUE;
$this->load->library('email');
$this->email->initialize($config);
$this->email->subject('TEST SUBJECT');
$this->email->message("THIS IS A TEST MESSAGE");
$this->email->from( "yyy@gmail.com"  );
$this->email->to("xxx@gmail.com");
if($this->email->send())
{
echo "success";
}
else
{
echo $this->email->print_debugger();
}
}
0

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector