Welcome Guest, Not a member yet? Register   Sign In
SMTP gmail help
#1

[eluser]blorriman[/eluser]
I apologize if I missed a thread in the forum, but I read through some of them and didn't find the answer I was looking for.

On my local server (localhost), my config/email.php is as follows, and it works great:
Code:
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.gmail.com';
$config['smtp_port'] = 465;
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'mypassword';
$config['newline'] = "\r\n";

But when I upload that to my host server I get the following error :
Quote:Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Permission denied)

Filename: libraries/Email.php

Any explanation/help would be greatly appreciated.
#2

[eluser]pickupman[/eluser]
Sound like your host maybe blocking that port. Open a ticket or a chat with them. Googling shows then need to have openssl enabled for php. You could check your config with a phpinfo();
#3

[eluser]kbauman[/eluser]
Here was my solution to using gmail. I had everything correct, but it wouldn't work until I added the following:
Code:
$config['smtp_timeout'] = 30;
$config['newline'] = "\r\n";
$config['crlf'] = "\r\n";
$config['mailtype'] = 'text';
$config['charset'] = 'utf-8';

I don't know which of those things made it work...I'm just happy it finally works.




Theme © iAndrew 2016 - Forum software by © MyBB