{"id":24625418,"url":"https://github.com/evyd13/django-o365mail","last_synced_at":"2025-04-12T13:35:00.008Z","repository":{"id":49809873,"uuid":"434938498","full_name":"evyd13/django-o365mail","owner":"evyd13","description":"Office 365 (O365) email backend for Django","archived":false,"fork":false,"pushed_at":"2024-09-25T09:19:47.000Z","size":121,"stargazers_count":22,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T08:48:04.517Z","etag":null,"topics":["backend","django","email","o365","office365"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evyd13.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-04T15:30:35.000Z","updated_at":"2025-02-25T03:18:35.000Z","dependencies_parsed_at":"2024-11-14T12:42:34.483Z","dependency_job_id":null,"html_url":"https://github.com/evyd13/django-o365mail","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":"0.16129032258064513","last_synced_commit":"0ea36a02d000964bd5a8201e12a66c41ea99a51a"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evyd13%2Fdjango-o365mail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evyd13%2Fdjango-o365mail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evyd13%2Fdjango-o365mail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evyd13%2Fdjango-o365mail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evyd13","download_url":"https://codeload.github.com/evyd13/django-o365mail/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248573770,"owners_count":21126900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","django","email","o365","office365"],"created_at":"2025-01-25T04:33:57.169Z","updated_at":"2025-04-12T13:34:59.969Z","avatar_url":"https://github.com/evyd13.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-o365mail\n\n## About\nSMTP authenthication is getting increasingly difficult, mainly because of security.\n\nThis Django email backend has been created to solve that problem when using Office 365. It's easy to use and quite customizable.\n\n## Installation\nRun the following on your system:\n\n    pip install django-o365mail\n\nThen, add these settings to your Django settings.py:\n\n    EMAIL_BACKEND = 'django_o365mail.EmailBackend'\n\n    O365_MAIL_CLIENT_ID = 'REPLACE THIS'\n    O365_MAIL_CLIENT_SECRET = 'REPLACE THIS'\n    O365_MAIL_TENANT_ID = 'REPLACE THIS'\n\nIf you're using git, make sure to add the following to `.gitignore`:\n\n    o365_token.txt\n\nMail can then be sent using the Django mail functions, as described [here](https://docs.djangoproject.com/en/3.2/topics/email/).\n\n## Optional settings\n\n### Mailbox\nThis module uses the `python-o365` library, which is also slightly customizable. Because of this you can define kwargs to be used when opening the mailbox. As an example:\n\n    O365_MAIL_ACCOUNT_KWARGS = {'token_backend': 'O365.utils.token.EnvTokenBackend'}\n    O365_MAIL_MAILBOX_KWARGS = {'resource': 'o365mailbox@domain.com'}\n\n... which will be passed to the mailbox() function like this:\n\n    account = O365.Account(credentials, auth_flow_type='credentials', tenant_id=self.tenant_id, **account_kwargs)\n    mailbox = account.mailbox(**O365_MAIL_MAILBOX_KWARGS)\n\n### Other\n- `O365_MAIL_REPLACE_LINE_ENDINGS` (default: `True`)  \n  Replaces line endings with an HTML line break (`\u003cbr /\u003e`) when emails are sent in plain text.\n- `O365_MAIL_SAVE_TO_SENT` (default: `False`)  \n  Saves sent emails to the 'Sent' folder.\n- `O365_SUBJECT_PREFIX` (default: `''`)  \n  Prefix for the subject of any email sent using this backend.\n- `O365_ACTUALLY_SEND_IN_DEBUG` (defaullt: `False`)  \n  The default value **prevents sending when DEBUG=True**. You most likely want to set this to `True` for development purposes. \n\n## Sandbox\nCreate a file called `settings_secret.py` under the `sandbox/sandbox` directory (same directory as `settings.py`) with the settings as described above, except for the `EMAIL_BACKEND`. It could look like this:\n\n    O365_MAIL_CLIENT_ID = 'REPLACE THIS'\n    O365_MAIL_CLIENT_SECRET = 'REPLACE THIS'\n    O365_MAIL_TENANT_ID = 'REPLACE THIS'\n\nThen, if needed, add settings to `settings.py`.\n\nTo be able to make changes to this module, run the following command to install this module in editable mode:\n\n    pip install -e ./\n\nAnd run the sandbox server:\n\n    cd sandbox \u0026\u0026 python manage.py runserver\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevyd13%2Fdjango-o365mail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevyd13%2Fdjango-o365mail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevyd13%2Fdjango-o365mail/lists"}