py-send-m365


Namepy-send-m365 JSON
Version 0.3.3 PyPI version JSON
download
home_pageNone
SummaryA simple library to send email from an existing M365 account in Python
upload_time2025-02-06 10:10:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseMIT
keywords email m365 microsoft smtp python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ### Send Emails via M365 from Python

This module provides a simple way to send emails via Microsoft 365. You need a valid Microsoft 365 user (email address) and password.

The `send_mail` method is used to send an email to any recipient. You can also pass a list of recipients here ["recipient1@example.com", "recipient2@example.com"]

The host defaults to `smtp.office365.com`, and the port defaults to `587`, but you can specify your own in the constructor if needed. 

#### Usage

from py_send_m365 import M365Mail

## Create an instance, providing optional host and port if needed

    mailer = M365Mail("myuser@domain.com", "mypassword", host="smtp.example.com", port=587)

## Send an email

    mailer.send_mail("recipient@domain.com", "My Subject", "The html <br><i>message</i> body")


## Send as

If you have allowed sending from other addresses for your user in m365, you can pass a custom from address. 

    mailer.send_mail("recipient@domain.com", "My Subject", "The html <br><i>message</i> body", "my-allowed-sender@domain.com")



            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "py-send-m365",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "email, M365, Microsoft, SMTP, Python",
    "author": null,
    "author_email": "Linus Pauls <hadoken79@protonmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/78/3f/2165ec71891d522898a5e1d6dc6f725db136e1c28ee2b22854273e6c2645/py_send_m365-0.3.3.tar.gz",
    "platform": null,
    "description": "### Send Emails via M365 from Python\n\nThis module provides a simple way to send emails via Microsoft 365. You need a valid Microsoft 365 user (email address) and password.\n\nThe `send_mail` method is used to send an email to any recipient. You can also pass a list of recipients here [\"recipient1@example.com\", \"recipient2@example.com\"]\n\nThe host defaults to `smtp.office365.com`, and the port defaults to `587`, but you can specify your own in the constructor if needed. \n\n#### Usage\n\nfrom py_send_m365 import M365Mail\n\n## Create an instance, providing optional host and port if needed\n\n    mailer = M365Mail(\"myuser@domain.com\", \"mypassword\", host=\"smtp.example.com\", port=587)\n\n## Send an email\n\n    mailer.send_mail(\"recipient@domain.com\", \"My Subject\", \"The html <br><i>message</i> body\")\n\n\n## Send as\n\nIf you have allowed sending from other addresses for your user in m365, you can pass a custom from address. \n\n    mailer.send_mail(\"recipient@domain.com\", \"My Subject\", \"The html <br><i>message</i> body\", \"my-allowed-sender@domain.com\")\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A simple library to send email from an existing M365 account in Python",
    "version": "0.3.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/hadoken79/py_send_m365/issues",
        "Homepage": "https://github.com/hadoken79/py_send_m365"
    },
    "split_keywords": [
        "email",
        " m365",
        " microsoft",
        " smtp",
        " python"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8fd813cfc8e61383f4356d9c1f18fdbf774a8e8797c91a648a637025f7a730ab",
                "md5": "518d7569ed925b61af4cf8bcc03967fe",
                "sha256": "8b6aa4f478e4dee14d60e1713274c1c5d4d884c45758557fd7beea64e6f9eb26"
            },
            "downloads": -1,
            "filename": "py_send_m365-0.3.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "518d7569ed925b61af4cf8bcc03967fe",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 3598,
            "upload_time": "2025-02-06T10:10:34",
            "upload_time_iso_8601": "2025-02-06T10:10:34.396395Z",
            "url": "https://files.pythonhosted.org/packages/8f/d8/13cfc8e61383f4356d9c1f18fdbf774a8e8797c91a648a637025f7a730ab/py_send_m365-0.3.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "783f2165ec71891d522898a5e1d6dc6f725db136e1c28ee2b22854273e6c2645",
                "md5": "a1afb54d7f6a23c4b571f1f2d0a5d349",
                "sha256": "7aa8aab34d0d2b5efc2e61e467c83ce9dd4e2d08f246b46538e3417713cef188"
            },
            "downloads": -1,
            "filename": "py_send_m365-0.3.3.tar.gz",
            "has_sig": false,
            "md5_digest": "a1afb54d7f6a23c4b571f1f2d0a5d349",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3168,
            "upload_time": "2025-02-06T10:10:35",
            "upload_time_iso_8601": "2025-02-06T10:10:35.240439Z",
            "url": "https://files.pythonhosted.org/packages/78/3f/2165ec71891d522898a5e1d6dc6f725db136e1c28ee2b22854273e6c2645/py_send_m365-0.3.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-06 10:10:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hadoken79",
    "github_project": "py_send_m365",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "py-send-m365"
}
        
Elapsed time: 1.49476s