I know this is a very common question but I just can't find the right answer to my question.
I'm using codeigniter with xampp and also this email server which is called miniRelay.
My configuration is this:
php.ini
extension=php_openssl.dll
[mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP = 127.0.0.1
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
; sendmail_from = postmaster@localhost
(I have a 32bits windows 7 professional)
in my controller:
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.gmail.com',
// 'smtp_port' => 465,
'smtp_port' => 25,
'smtp_user' => 'mymail@gmail.com',
'smtp_pass' => 'mypass',
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from(anothermail@gmail.com, "from contact form");
$this->email->to("mymail@gmail.com");
// $this->email->cc("testcc@domainname.com");
$this->email->subject("This is test subject line");
$this->email->message("Mail sent test message...");
$data['message'] = "Sorry Unable to send email...";
if($this->email->send()){
$data['message'] = "Mail sent...";
}
Then, what I do is to turn on minirelay server on... it says that is listening to port 25 ... but then shows no activity when sending a test email.
The error that I'm getting is:
fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
fsockopen(): Failed to enable crypto
fsockopen(): unable to connect to ssl://smtp.gmail.com:25 (Unknown error)
I'm not really a fan of protocols and I'm having a hard time... I would like some guidance please..