Auth with SMTP

Skip to first unread message

Matthew Brown

Jun 14, 2022, 2:30:33 PM6/14/22
to Fat-Free Framework

I'm try go get Auth working with SMTP as the storage resource. I can't get it to work and assume I'm making some fundamental mistake. Does anyone have an example or some sudo code of what this would look like? Ideally I'd like to make this work with HTTP basic authentication, but I've been trying Login as well. My latest config attempt is:

$user = new \SMTP('localhost', 25, NULL, $username, $password);
$auth = new \Auth($user, array('id' => 'username', 'pw' => 'password'));

I've also tried changing from basic to login:
$login_result = $auth->login('emailusername', 'emailpassword');

I assume the issue is with how I'm initializing or calling the SMTP storage as I get this error:
Object of class SMTP could not be converted to string.

I've tried other ports and SSL & TLS as well, with the same result.

Any pointers would be greatly appreciated.


Jun 18, 2022, 2:35:29 AM6/18/22
to Fat-Free Framework

funny I didn't even knew that this was possible at all :D
I checked the code that it appears that SMTP cannot just be used here.. syntax is:

$auth = new \Auth('smtp', [
    'host' => '',
    'port' => 25,
    'scheme' => null,

Matthew Brown

Jun 22, 2022, 12:25:21 PM6/22/22
to ikkez über Fat-Free Framework
Thanks for confirming the correct syntax. I tested it and this works. Yeah, I was surprised to see this feature too. I happen to have a use case for this and it is perfect for my app.

-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to To unsubscribe from this group, send an email to For more options, visit this group at
You received this message because you are subscribed to a topic in the Google Groups "Fat-Free Framework" group.
To unsubscribe from this topic, visit
To unsubscribe from this group and all its topics, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages