Welcome Guest, Not a member yet? Register   Sign In
Email class Auth Problem
#1

[eluser]The Casual Bot[/eluser]
Im trying to send smtp email via CI email Class

this keeps failing i spoke to myy host about the smtp server(authsmtp.com) and they can telnet from there end i so can i

i spoke to authsmtp and they said they haven't blocked my servers ip

i read on the CI forum Here about some over peeps issues and tried there fixes for them but nothing seems to have worked


at first i was getting the following error

Code:
The following SMTP error was encountered: 0 Success
Unable to send data: AUTH LOGIN
Failed to send AUTH LOGIN command. Error:
Unable to send data: MAIL FROM:<>

so i changed my config from
Code:
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'mail.authsmtp.com';
$config['smtp_user'] = '******';
$config['smtp_pass'] = '******';
$config['smtp_port'] = '25252';
$config['crlf'] = '\r\n';
$config['newline'] = '\r\n';
$config['smtp_timeout'] = '5';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';
$this->email->initialize($config);

to

Code:
$config['protocol'] = "smtp";
$config['smtp_host'] = "mail.authsmtp.com";
$config['smtp_user'] = "ac34362";
$config['smtp_pass'] = "lockedout";
$config['smtp_port'] = "25252";
$config['crlf'] = "\r\n";
$config['newline'] = "\r\n";
$config['smtp_timeout'] = "5";
$config['charset'] = "iso-8859-1";
$config['wordwrap'] = TRUE;
$config['mailtype'] = "html";
$this->email->initialize($config);

and now i get

Code:
The following SMTP error was encountered: 111 Connection refused
Unable to send data: AUTH LOGIN
Failed to send AUTH LOGIN command. Error:
Unable to send data: MAIL FROM:<>

and heres my code
PS. i have load this class in the constructor

Code:
//set up email ready for sending
$this->email->from('[email protected]', $data['0']['a_referer']);
$this->email->to($data['0']['email']);
$this->email->subject('Your Visa Application REF: '.strtoupper($data['0']['a_type']).$data['0']['application_id']);


//create  email
$email = "Dear ".ucwords($data['0']['name']).",

you can stop banging your head on the wall it worked :D
";

$config['protocol'] = "smtp";

$config['smtp_host'] = "mail.authsmtp.com";
$config['smtp_user'] = "ac34362";
$config['smtp_pass'] = "lockedout";
$config['smtp_port'] = "25252";
$config['crlf'] = "\r\n";
$config['newline'] = "\r\n";
$config['smtp_timeout'] = "5";
$config['charset'] = "iso-8859-1";
$config['wordwrap'] = TRUE;
$config['mailtype'] = "html";
$this->email->initialize($config);

//send email
$this->email->message($email);
$this->email->send();

echo $this->email->print_debugger();

Thanks for any help guys'n'girls
#2

[eluser]Unknown[/eluser]
same here
#3

[eluser]Unknown[/eluser]
I'm experiencing the exact same thing. I did see in an earlier thread to remove the "initialize" line and instead use this when calling the library.
Code:
$this->load->library('email', $config);
That didn't help me though.
#4

[eluser]tatacarrera[/eluser]
exactly the same problem for me
#5

[eluser]InsiteFX[/eluser]
I have posted a whole article on this on the forums here, do a forum search on emial!

But to get you started you need to setup your smtp parameters in php.ini

InsiteFX
#6

[eluser]tatacarrera[/eluser]
I've changed the:
$config['protocol'] = "smtp";
to:
$config['protocol'] = "sendmail";
and now it work's
#7

[eluser]Unknown[/eluser]
Thanks Tatacarrera, that seems to have solved my issue also.




Theme © iAndrew 2016 - Forum software by © MyBB