icloud-email


Nameicloud-email JSON
Version 2.0.0 PyPI version JSON
download
home_pageNone
SummarySimple utility for sending emails via iCloud.
upload_time2024-08-21 10:55:50
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # icloud-email

This is a Python package that provides the function `send_email`:

    def send_email(service_name, recipient, subject, html, attachments=[]):
        sender = f"{service_name} <{SENDER_EMAIL_ADDRESS}>"

        msg = MIMEMultipart()
        msg['From'] = sender
        msg['To'] = recipient
        msg['Date'] = formatdate(localtime=True)
        msg['Subject'] = subject
        msg.attach(MIMEText(html, 'html'))
        for attachment in attachments:
            msg.attach(attachment)
        # Send it off via smtp.mail.me.com
        context = create_default_context()
        with SMTP("smtp.mail.me.com", 587) as smtp:
            smtp.starttls(context=context)
            smtp.login(ICLOUD_USERNAME, ICLOUD_PASSWORD)
            smtp.sendmail(sender, recipient, msg.as_string())

## Installation

    pip install icloud-email

## Usage

    from email.mime.application import MIMEApplication
    from icloud_email import send_email

    attachment = MIMEApplication(b"File contents", name="filename.txt")
    attachment['Content-Disposition'] = 'attachment; filename="filename.txt"'

    send_email(
        "Example Service",
        "recipient@example.org",
        "Re: Example Subject",
        "<h1>This is an example email</h1>",
        [attachment],
    )

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "icloud-email",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Mizuki Hikaru <mizuki@hikaru.org>",
    "download_url": "https://files.pythonhosted.org/packages/42/d0/baed04e8c0a06a2807cde5e733716c2b3d634601cd764cb17e7c595fa21a/icloud_email-2.0.0.tar.gz",
    "platform": null,
    "description": "# icloud-email\n\nThis is a Python package that provides the function `send_email`:\n\n    def send_email(service_name, recipient, subject, html, attachments=[]):\n        sender = f\"{service_name} <{SENDER_EMAIL_ADDRESS}>\"\n\n        msg = MIMEMultipart()\n        msg['From'] = sender\n        msg['To'] = recipient\n        msg['Date'] = formatdate(localtime=True)\n        msg['Subject'] = subject\n        msg.attach(MIMEText(html, 'html'))\n        for attachment in attachments:\n            msg.attach(attachment)\n        # Send it off via smtp.mail.me.com\n        context = create_default_context()\n        with SMTP(\"smtp.mail.me.com\", 587) as smtp:\n            smtp.starttls(context=context)\n            smtp.login(ICLOUD_USERNAME, ICLOUD_PASSWORD)\n            smtp.sendmail(sender, recipient, msg.as_string())\n\n## Installation\n\n    pip install icloud-email\n\n## Usage\n\n    from email.mime.application import MIMEApplication\n    from icloud_email import send_email\n\n    attachment = MIMEApplication(b\"File contents\", name=\"filename.txt\")\n    attachment['Content-Disposition'] = 'attachment; filename=\"filename.txt\"'\n\n    send_email(\n        \"Example Service\",\n        \"recipient@example.org\",\n        \"Re: Example Subject\",\n        \"<h1>This is an example email</h1>\",\n        [attachment],\n    )\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Simple utility for sending emails via iCloud.",
    "version": "2.0.0",
    "project_urls": {
        "Homepage": "https://github.com/mizuki-hikaru/icloud-email",
        "Issues": "https://github.com/mizuki-hikaru/icloud-email/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d5e10bf6f0d90ea5830b73d347eb2d404707f51a5926c39e5a65da49ee4634f6",
                "md5": "0e867e8989b166b84a0efb717757a4fa",
                "sha256": "5c544c7c8c154ff38bec02371482dbbaf18f6341cee4c908fc28cc17733dfaf6"
            },
            "downloads": -1,
            "filename": "icloud_email-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0e867e8989b166b84a0efb717757a4fa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 3143,
            "upload_time": "2024-08-21T10:55:49",
            "upload_time_iso_8601": "2024-08-21T10:55:49.145106Z",
            "url": "https://files.pythonhosted.org/packages/d5/e1/0bf6f0d90ea5830b73d347eb2d404707f51a5926c39e5a65da49ee4634f6/icloud_email-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "42d0baed04e8c0a06a2807cde5e733716c2b3d634601cd764cb17e7c595fa21a",
                "md5": "6d910d228ddd936a25a1368b9b9c4716",
                "sha256": "a78f3d32596e16283e4bc6455e7c85fb3eb1700aa7f83044252293acf30260d5"
            },
            "downloads": -1,
            "filename": "icloud_email-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6d910d228ddd936a25a1368b9b9c4716",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 2204,
            "upload_time": "2024-08-21T10:55:50",
            "upload_time_iso_8601": "2024-08-21T10:55:50.696178Z",
            "url": "https://files.pythonhosted.org/packages/42/d0/baed04e8c0a06a2807cde5e733716c2b3d634601cd764cb17e7c595fa21a/icloud_email-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-21 10:55:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mizuki-hikaru",
    "github_project": "icloud-email",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "icloud-email"
}
        
Elapsed time: 0.62268s