[eluser]Unknown[/eluser]
Send mail from localhost to Gmail error help me. I'm using XAMPP server and MercuryMail. I've tested the Mercury mail and it works normally, but do not know why I still can not send mail from localhost Address to Gmail. Below is the image error, and my code
Error
Code:
An Error Was Encountered
The following SMTP error was encountered: 0 php_network_getaddresses: getaddrinfo failed: No such host is known.
Unable to send data: AUTH LOGIN
Failed to send AUTH LOGIN command. Error:
Unable to send data: MAIL FROM:
from:
The following SMTP error was encountered:
Unable to send data: RCPT TO:
to:
The following SMTP error was encountered:
Unable to send data: DATA
data:
The following SMTP error was encountered:
Unable to send data: User-Agent: CodeIgniter Date: Sat, 25 Dec 2010 17:04:12 +0700 From: "admin" Return-Path: To: [email protected] Subject: =?utf8?Q?Test_mail_?= Reply-To: "laptrinhvien.net@localhost" X-Sender: laptrinhvien.net@localhost X-Mailer: test X-Priority: 3 (Normal) Message-ID: <4d15c19bf3b88@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Working bravo
Unable to send data: .
The following SMTP error was encountered:
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
User-Agent: CodeIgniter
Date: Sat, 25 Dec 2010 17:04:12 +0700
From: "admin"
Return-Path:
To: [email protected]
Subject: =?utf8?Q?Test_mail_?=
Reply-To: "laptrinhvien.net@localhost"
X-Sender: laptrinhvien.net@localhost
X-Mailer: test
X-Priority: 3 (Normal)
Message-ID: <4d15c19bf3b88@localhost>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
Working bravo
My code :
Code:
<?php
/**Send mail by localhost
*
*/
class Email extends Controller
{
function __construct()
{
parent::Controller();
}
function index()
{
$config = Array(
'protocol'=>'smtp',
'smtp_host'=>'ssl://smtp.googlemail.com',
'smtp_post'=>465,
'smtp_user'=>'[email protected]',
'smtp_pass'=>'my_password_go_to_email',
'mailtype'=>'text',
'useragent'=>'test',
'charset'=>'utf8',
'wordwrap'=>TRUE
);
$this->load->library('email',$config);
$this->email->set_newline("\r\n");
$this->email->From('[email protected]','admin');
$this->email->To('[email protected]');
$this->email->Subject('Test mail ');
$this->email->message('Working bravo');
if($this->email->send())
{
echo 'Send Mail successful. ';
}
else {
show_error($this->email->print_debugger());
}
}
}
?>
I have XAMPP server config how to send mail from localhost. Please guide me, thanks