Auth with SMTP

瀏覽次數:72 次
跳到第一則未讀訊息

Matthew Brown

未讀,
2022年6月14日 下午2:30:332022/6/14
收件者:Fat-Free Framework
Hello,

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'));
$auth->basic();

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.

ikkez

未讀,
2022年6月18日 凌晨2:35:292022/6/18
收件者:Fat-Free Framework
Hi..

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' => 'smtp.domain.com',
    'port' => 25,
    'scheme' => null,
]);
$auth->basic(); 

Matthew Brown

未讀,
2022年6月22日 中午12:25:212022/6/22
收件者: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 f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/f3-framework?hl=en
---
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 https://groups.google.com/d/topic/f3-framework/6NZX1s8uEUs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to f3-framework...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/f3-framework/ddf1479f-0527-4387-b66e-240048b1bf44n%40googlegroups.com.
回覆所有人
回覆作者
轉寄
0 則新訊息