Welcome Guest, Not a member yet? Register   Sign In
SMTP username error
#1

[eluser]gareth_w[/eluser]
Hi,

I'm setting up SMTP email locally (Windows) and for testing purposes using my BT account to send email.

I've created an config/email.php config (as recommended in the user guide) and set all the config options there.

When I come to send an email I'm getting this error message:

220 smtp821.mail.ird.yahoo.com ESMTP

hello: 250-smtp821.mail.ird.yahoo.com
250-AUTH LOGIN PLAIN XYMCOOKIE
250-PIPELINING
250 8BITMIME

Failed to authenticate username. Error: 451 Invalid Smtp line - Should end with CRLF

I've double and triple checked the username and password credentials and use them all the time so I'm confident they are correct but codeigniter is telling me otherwise. The config I have is:

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'my.isp.com';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'my_password';
$config['smtp_port'] = '25';
$config['crlf'] = "\r\n";
$config['admin_emails'] = array('[email protected]')

Does anybody have any ideas what might be causing the username error - am I missing a level of authentication?

Cheers,
Gaz
#2

[eluser]OES[/eluser]
Hey Gaz

I would check the settings on your editor (Line Endings). As per the error (Failed to authenticate username. Error: 451 Invalid Smtp line - Should end with CRLF)

I would also dicth the idea of using CI's email library with SMTP. Just done a simple email lib for a client due to SMTP not being able to connect to rackspace mail but worked perfect with swiftmail with same settings.

Hope this helps a little.
#3

[eluser]gareth_w[/eluser]
Hi,

Thanks for getting back to me, the SMTP wrapper functions are self contained so I would have thought CodeIgniter would handle line endings for email within those functions?

You might be right though, ditching CodeIgniter for SMTP. I'll make a few adjustments to the config maybe and see what happens.

Any other ideas?

Cheers,
Gaz
#4

[eluser]gareth_w[/eluser]
Hi,

I managed to figure out the problem and smtp email is working now! All I needed to change was the new line definition from:

$config['crlf'] = "\r\2"n;

to:
$config['newline'] = "\r\n";

Hope this helps someone else out.

Cheers,
Gaz




Theme © iAndrew 2016 - Forum software by © MyBB