Reputation: 171
My site is on Godaddy hosting which have PHP version 5.4.34. I used the codeigniters email library, I have configured the following settings in email.php under the config folder.
<?php
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.gmail.com';
$config['smtp_port'] = '465';
$config['smtp_user'] = 'gmail account email';
$config['smtp_pass'] = 'pass';
$config['charset'] = 'utf-8';
$config['newline'] = "\r\n";
?>
Here is my code in controller file.
<?php
$msg ='';
$msg .='<h3>Thank you for register</h3>';
$msg .='Please follow The bellow link.';
$this->email->from('[email protected]', 'Kayah Photography');
$this->email->to($_POST['email']);
$this->email->subject('Kayah Photography: Registration');
$this->email->message($msg);
if($this->email->send()) {
$html ='';
$html .= '<div class="alert alert-success" role="alert">';
$html .='Please check your email for details';
$data['error'] = '';
$data['success'] = $html;
//$this->load->view('admin/new_en', $data);
redirect('admin/signup');
} else { // email else
show_error($this->email->print_debugger());
} // email else end
?>
After all the above setting I am unable to solve the following error please anybody know how to fix this.
A PHP Error was encountered
Severity: Warning
Message: fsockopen(): unable to connect to ssl://smtp.googlemail.com:465 (Connection refused)
Filename: libraries/Email.php
Line Number: 1689
Upvotes: 0
Views: 219
Reputation: 4784
GoDaddy blocks all outgoing SMTP connections on their hosting. You will have to use their SMTP relay servers instead, or use a different host.
http://help.godaddy.com/article/955
http://www.satollo.net/godaddy-using-smtp-external-server-on-shared-hosting
Upvotes: 2