{"id":34725730,"url":"https://github.com/suqingdong/mailkit","last_synced_at":"2026-05-24T01:32:15.771Z","repository":{"id":194486863,"uuid":"690875869","full_name":"suqingdong/mailkit","owner":"suqingdong","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-14T06:23:12.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-26T13:38:56.205Z","etag":null,"topics":["email","sendemail","smtp","smtplib"],"latest_commit_sha":null,"homepage":"https://mailkit.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suqingdong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-13T04:09:31.000Z","updated_at":"2024-02-28T09:25:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5210b05-57d5-48b2-ac35-e959deb93ebc","html_url":"https://github.com/suqingdong/mailkit","commit_stats":null,"previous_names":["suqingdong/mailkit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suqingdong/mailkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suqingdong%2Fmailkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suqingdong%2Fmailkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suqingdong%2Fmailkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suqingdong%2Fmailkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suqingdong","download_url":"https://codeload.github.com/suqingdong/mailkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suqingdong%2Fmailkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33418547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T22:14:44.296Z","status":"ssl_error","status_checked_at":"2026-05-23T22:14:43.778Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["email","sendemail","smtp","smtplib"],"created_at":"2025-12-25T02:27:04.239Z","updated_at":"2026-05-24T01:32:15.748Z","avatar_url":"https://github.com/suqingdong.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Read the Docs (version)](https://img.shields.io/readthedocs/mailkit/latest)\n![PyPI - License](https://img.shields.io/pypi/l/mailkit)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mailkit)\n![PyPI - Version](https://img.shields.io/pypi/v/mailkit)\n![GitHub repo size](https://img.shields.io/github/repo-size/suqingdong/mailkit)\n![GitHub top language](https://img.shields.io/github/languages/top/suqingdong/mailkit)\n![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/suqingdong/mailkit)\n\n# A user-friendly Python email toolkit\n\n## Installation\n\n```bash\npython3 -m pip install mailkit\n```\n\n## Usage on CMD\n\n```bash\nUsage: mailkit [OPTIONS] COMMAND [ARGS]...\n\n  A user-friendly Python email toolkit\n\nOptions:\n  --version              Show the version and exit.\n  -H, --host TEXT        SMTP server hostname or IP address\n  -P, --port INTEGER     SMTP server port\n  -u, --username TEXT    SMTP server username\n  -p, --password TEXT    SMTP server password\n  -s, --use-ssl BOOLEAN  Use SSL connection  [default: True]\n  -t, --timeout INTEGER  SMTP server timeout  [default: 10]\n  -e, --env-file TEXT    The environment file to load  [default: ~/.mailkit.env]\n  -h, -?, --help         Show this message and exit.\n\nCommands:\n  config  initialize the configuration file\n  send    send email to user(s)\n```\n\n### *`mailkit config`*\n\n```bash\nUsage: mailkit config [OPTIONS]\n\n  initialize the configuration file\n\nOptions:\n  -s, --show      show the current configuration\n  -?, -h, --help  Show this message and exit.\n\n\nmailkit config\n# flowing the instruction to complete the configuration\n\"\n\u003e\u003e\u003e SMTP host: smtp.exmail.qq.com\n\u003e\u003e\u003e SMTP port [465]: \n\u003e\u003e\u003e SMTP username: suqingdong@novogene.com\n\u003e\u003e\u003e SMTP password: \n\u003e\u003e\u003e SMTP use ssl [True]: \n\u003e\u003e\u003e SMTP timeout [10]: \nlogin success.\nSaved configuration to ~/.mailkit.env\n\"\n\n# you can also use envernment variables\nexport SMTP_HOST=smtp.gmail.com\nexport SMTP_PORT=465\nexport SMTP_USERNAME=suqingdong@gmail.com\nexport SMTP_PASSWORD=YOUR_PASSWORD\nexport SMTP_USE_SSL=True\nexport SMTP_TIMEOUT=10\n```\n\n### *`mailkit send`*\n\n```bash\nUsage: mailkit send [OPTIONS]\n\n  send email to user(s)\n\nOptions:\n  -f, --from-addr TEXT     the display address of the sender, default is the login username\n  -t, --to-addrs TEXT      the recipient address(es)  [required]\n  -s, --subject TEXT       the subject of the email  [required]\n  -b, --body TEXT          the body of the email\n  -a, --attachments TEXT   the attachments of the email\n  -C, --charset TEXT       the charset of the email  [default: utf-8]\n  -c, --content-type TEXT  the content type of the email, eg.: plain, html [default: plain]\n  -cc, --cc TEXT           the cc address(es)\n  -bcc, --bcc TEXT         the bcc address(es)\n  -h, -?, --help           Show this message and exit.\n\n\n# Examples:\n\n# basic usage\nmailkit send -t \"to@example.com\" -s \"subject\" -b \"body\"\n\n# use charset\nmailkit send -t \"to@example.com\" -s \"subject\" -b \"body\" -C \"gbk\"\n\n# use content-type\nmailkit send -t \"to@example.com\" -s \"subject\" -b \"\u003ch1\u003ebody\u003c/h1\u003e\" -C \"utf-8\" -c \"html\"\n\n# use cc and bcc\nmailkit send -t \"to@example.com\" -s \"subject\" -b \"body\" -cc \"cc@example.com\" -bcc \"bcc@example.com\"\n\n# use attachments\nmailkit send -t \"to@example.com\" -s \"subject\" -b \"body\" -a \"attachment.txt\"\n\n# multiple parameters\nmailkit send -t \"to_1@example.com\" -t \"to_2@example.com\" -s \"subject\" -b \"body\" -a \"attachment.txt\" -a \"attachment_2.txt\"\n\n# auth with parameters\nmailkit -H smtp.gmail.com -u username@gmail.com -p password send -t \"to@example.com\" -s \"subject\" -b \"body\"\n\n# auth with an env_file\nmailkit -e .env send -t \"to@example.com\" -s \"subject\" -b \"body\"\n```\n\n## Usage in Python\n\n```python\nfrom mailkit.core import SendEmail\n\n# default auth with ~/.mailkit.env\nmail = SendEmail() \n\n# basic usage\nmail.send('to@example.com', 'subject', 'body')\n\n# use content-type\nmail.send('to@example.com', 'subject', '\u003ch1\u003ebody\u003c/h1\u003e', content_type='html')\n\n# use attachments\nmail.send('to@example.com', 'subject', 'body', attachments=['attachment.txt'])\n\n# close the connection\nmail.close()\n\n# use with mode\nwith SendEmail() as mail:\n    mail.send('to@example.com', 'subject', 'body')\n\n\n# auth with another env_file\nmail = SendEmail(_env_file='.env')\n\n\n# auth with parameters\nmail = SendEmail(host='smtp.gmail.com', port=465, username='username@gmail.com', password='password')\n\n\n# auth wiht environtment variables\nimport os\nos.environ['SMTP_HOST'] = 'smtp.gmail.com'\nos.environ['SMTP_PORT'] = 465\nos.environ['SMTP_USERNAME'] = 'username@gmail.com'\nos.environ['SMTP_PASSWORD'] = 'password'\nos.environ['SMTP_USE_SSL'] = True\nos.environ['SMTP_TIMEOUT'] = 10\nmail = SendEmail()\n```\n\n### `mailkit.core.SendEmail`\n\n```python\nclass SendEmail(mailkit.core.smtp.config.SmtpConfig)\n |  SendEmail(_case_sensitive: 'bool | None' = None,_env_prefix: 'str | None' = None, _env_file: 'DotenvType | None' = PosixPath('.'), _env_file_encoding: 'str | None' = None, _env_nested_delimiter: 'str | None' = None, _secrets_dir: 'str | Path | None' = None, *, host: str, port: Union[int, NoneType] = None, username: str, password: str, use_ssl: bool = True, use_tls: bool = False, timeout: int = 10) -\u003e None\n |  \n |  send(from_addr: str, to_addrs: Union[str, List[str]], subject: str, body: str = '', content_type: str = 'plain', charset: str = 'utf-8', cc: Union[str, List[str]] = '', bcc: Union[str, List[str]] = '', attachments: Union[str, List[str], NoneType] = None) -\u003e None\n |  \n |  close(self)\n |  \n |  login(self)\n |  \n |  model_dump(self, *, mode: \"Literal[('json', 'python')] | str\" = 'python', include: 'IncEx' = None, exclude: 'IncEx' = None, by_alias: 'bool' = False, exclude_unset: 'bool' = False, exclude_defaults: 'bool' = False, exclude_none: 'bool' = False, round_trip: 'bool' = False, warnings: 'bool' = True) -\u003e 'dict[str, Any]'\n\n```\n\n\n## Documents\n\nhttps://mailkit.readthedocs.io/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuqingdong%2Fmailkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuqingdong%2Fmailkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuqingdong%2Fmailkit/lists"}