CodeIgniter Forums
SMTP with the Email Class and no AUTH - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: SMTP with the Email Class and no AUTH (/showthread.php?tid=24713)



SMTP with the Email Class and no AUTH - El Forum - 11-17-2009

[eluser]jeffpeck[/eluser]
We use an SMTP protocol that looks like this:

Code:
$connection = @fsockopen ($host, 25, $errno, $errstr, 1);
$res = @fgets($connection,256);

@fputs($connection, "HELO $mydomain\r\n");
$res = @fgets($connection,256);

@fputs($connection, "MAIL FROM: $from\r\n");
$res = @fgets($connection,256);

@fputs($connection, "RCPT TO: $to\r\n");
$res = @fgets($connection,256);

@fputs($connection, "DATA\r\n");
$res = @fgets($connection,256);

@fputs($connection, "To: $to\r\nFrom: $from\r\nSubject: $subject\r\n$headers\r\n\r\n$message\r\n.\r\n");
$res = @fgets($connection,256);

@fputs($connection,"QUIT\r\n");
$res = @fgets($connection,256);

This works.

However, I would like to use the Codeigniter Email Class. So I set it up using SMTP with our host name and no user or pass and... nothing. It seems to be timing out at (or after) the HELO phase according to $this->email->print_debugger();

I think it has something to do with there being no username or password. Would I have to manually change the SMPT Email Class to adjust for this or is there an option to make it skip the authentication? Has anybody else had a similar issue?

Thanks.


SMTP with the Email Class and no AUTH - El Forum - 11-18-2009

[eluser]jeffpeck[/eluser]
Ok, it works now. It was actually the line endings.

For anybody who finds this thread... first try changing 'newline' to "\r\n". For us, it is the only thing our SMTP server will work with.