Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to merge multiple email accounts in folder eg inbox #476

Open
ssekimuli opened this issue Jul 6, 2023 · 8 comments
Open

how to merge multiple email accounts in folder eg inbox #476

ssekimuli opened this issue Jul 6, 2023 · 8 comments
Labels

Comments

@ssekimuli
Copy link

ssekimuli commented Jul 6, 2023

how to merge multiple email accounts in folder eg inbox

@ssekimuli ssekimuli changed the title how to manage multiple email accounts in folder eg inbox how to merge multiple email accounts in folder eg inbox Jul 6, 2023
@Webklex
Copy link
Owner

Webklex commented Jul 6, 2023

Hi @ssekimuli ,
thanks for posting your question.
I'm not really sure what you are asking.. Please add a brief description or a theoretical example.

Best regards and happy coding,

@ssekimuli
Copy link
Author

ssekimuli commented Jul 6, 2023 via email

@Webklex
Copy link
Owner

Webklex commented Jul 6, 2023

Thanks for clarifying. You can configure as many accounts as you like inside your config
https://github.com/Webklex/laravel-imap/blob/master/src/config/imap.php#L47 or by providing the same array as options during the initialization https://www.php-imap.com/api/client-manager
Afterwards you can access each configured account via:

/** @var \Webklex\PHPIMAP\ClientManager $cm */
/** @var \Webklex\PHPIMAP\Client $client */

$client = $cm->account('account_identifier');

You could also store the account information somewhere else and just create a new instance on the fly if needed:

/** @var \Webklex\PHPIMAP\ClientManager $cm */
/** @var \Webklex\PHPIMAP\Client $client */

$client = $cm->make([
    'host'          => 'somehost.com',
    'port'          => 993,
    'encryption'    => 'ssl',
    'validate_cert' => true,
    'username'      => 'username',
    'password'      => 'password',
    'protocol'      => 'imap'
]);

Best regards & happy coding,

@ssekimuli
Copy link
Author

i want to config two emails accounts at once . let say i have outlook and gmail and i want them to under on folder

@Webklex
Copy link
Owner

Webklex commented Jul 6, 2023

I see, unfortunately that's not possible - or at least not that I know of. The folders e.g. "INBOX" are located on two different servers which don't know of each other and have nothing in common besides their name. If you want to fetch both, you'll have to connect to both and do what ever you like to do to each folder individually :)

Best regards & happy coding,

@Webklex
Copy link
Owner

Webklex commented Jul 6, 2023

P.s.: there is something called "shared inbox" but it has nothing to do with this library and I doubt you could create a shared inbox across providers but you never know :)
Google or DuckDuckGo can probably tell you more about this topic.

@ssekimuli
Copy link
Author

getSharedMailbox() do you have this function

so that is connect

sharedMailbox = $client->getSharedMailbox('sharedinbox');

@Webklex
Copy link
Owner

Webklex commented Jul 6, 2023

Hi @ssekimuli ,
thanks for the followup. No, such a function doesn't exists - at least not one with this name. What are you expecting this method to do? Perhaps a similar function does exist. Like $client->getFolder("someName") ?

Please try to provide a bit more context, code or examples. Tell the world what you are up to :)

Best regards & happy coding,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants