error in sending email - El Forum - 04-13-2011
[eluser]talwinder[/eluser]
hi, i am trying to send the email using email class in codeigniter.
i am getting the following error:
Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.googlemail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)
this is the code below.
Code: function email (){
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'password'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]');
$this->email->to('[email protected]');
$this->email->subject('this is a email test');
$this->email->message('this is the email iam trying to send from codeigniter');
if($this->email->send()){
echo 'you email was sent successfully';
}
else{
show_error($this->email->print_debugger());
}
}
error in sending email - El Forum - 04-13-2011
[eluser]InsiteFX[/eluser]
Simple test code, this would allow you to check your PHP capabilities and your hosting provider's firewall settings
Code: <?php
$fp = fsockopen("www.google.com", 80, &$errno, &$errstr, 10); // work fine
if ( ! $fp)
{
echo "www.google.com - $errstr($errno)<br>\n";
}
else
{
echo "www.google.com - ok<br>\n";
$fp = fsockopen("smtp.gmail.com", 465, &$errno, &$errstr, 10); // NOT work
if ( ! $fp)
{
echo "smtp.gmail.com 465 - $errstr($errno)<br>\n";
}
else
{
echo "smtp.gmail.com 465 - ok<br>\n";
$fp = fsockopen("smtp.gmail.com", 587, &$errno, &$errstr, 10); // NOT work
}
if ( ! $fp)
{
echo "smtp.gmail.com 587 - $errstr($errno)<br>\n";
}
else
{
echo "smtp.gmail.com 587 - ok<br>\n";
echo "<br />".phpinfo();
}
?>
InsiteFX
error in sending email - El Forum - 04-13-2011
[eluser]talwinder[/eluser]
still can't fix it. getting the following errors
Code: Deprecated: Call-time pass-by-reference has been deprecated in C:\wamp\www\imagic.php on line 3
Deprecated: Call-time pass-by-reference has been deprecated in C:\wamp\www\imagic.php on line 3
Deprecated: Call-time pass-by-reference has been deprecated in C:\wamp\www\imagic.php on line 12
Deprecated: Call-time pass-by-reference has been deprecated in C:\wamp\www\imagic.php on line 12
Deprecated: Call-time pass-by-reference has been deprecated in C:\wamp\www\imagic.php on line 21
Deprecated: Call-time pass-by-reference has been deprecated in C:\wamp\www\imagic.php on line 21
Parse error: syntax error, unexpected $end in C:\wamp\www\imagic.php on line 35
error in sending email - El Forum - 04-13-2011
[eluser]InsiteFX[/eluser]
Well that means there is a problem with imagic.php
Make sure your running the latest version of WAMP.
InsiteFX
|