Welcome Guest, Not a member yet? Register   Sign In
Email notification with CI and hotmail
#1

[eluser]muttalebm[/eluser]
Hi guys,
I am trying to create an email notification system with CI. The problem is the system on which I am working on has blocked gmail. So, i am unable to use the gmail SMTP. Now, I have to figure out a way to send emails with hotmail or any other SMTP services.
Here is my code which worked for gmail but now for hotmail
config/Email.php:
Code:
$config = array(
    'protocol' => 'smtp',
    'smtp_host' => 'ssl://smtp.live.com',
    'smtp_port' => 587,
    'smtp_user' => '[email protected]',
    'smtp_pass' => 'XXXXXX',
    'charset' => 'utf-8',
'newline' => "\r\n",
'crlf' => "\r\n",
'mailtype' => "html",


);

the actual function that calls the email.php and send the email:
Code:
function sends($from,$to,$send,$user){
   $link=base_url()."index.php/anonymouscoll/cmembersarea/".$user;
   $emailmessage="Hello $to,<br />You have a new Gift from $from.<br />Click on the link:<a href=$link>$link</a> to check your gift.<br /><br /><br />Best Regards<br />Online Communication.";
   $this->load->library('email');
   $this->email->from('[email protected]','Gift File');
   $this->email->to($send);
   $this->email->subject('You have a new Gift');
   $this->email->message($emailmessage);
  
   if($this->email->send()){
    echo "Email sent";
    
   }
   else{
    show_error($this->email->print_debugger());
   }

Each time i call the 'sends' function i get the below error:
Code:
Severity: Warning

Message: fsockopen() [function.fsockopen]: SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

Filename: libraries/Email.php

Line Number: 1673
and
Code:
Severity: Warning

Message: fsockopen() [function.fsockopen]: Failed to enable crypto

Filename: libraries/Email.php

Line Number: 1673
I have also tried with
Quote:'smtp_host' => 'sslv2://smtp.live.com',
but it just wont work on my local machine.
I am using windows 7 on my local machine and windows Xp for the system I will use the application[the one which blocked gmail]. I tried with both XAMPP ver 1.8.1 and WAMPP ver 2.2

Looking forward for your responses :-)

~muttalebm


Messages In This Thread
Email notification with CI and hotmail - by El Forum - 11-30-2012, 12:52 PM
Email notification with CI and hotmail - by El Forum - 12-07-2012, 03:12 AM
Email notification with CI and hotmail - by El Forum - 12-07-2012, 05:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB