{"id":13439214,"url":"https://github.com/lettre/lettre","last_synced_at":"2025-05-14T22:05:30.079Z","repository":{"id":13786501,"uuid":"16481777","full_name":"lettre/lettre","owner":"lettre","description":"a mailer library for Rust","archived":false,"fork":false,"pushed_at":"2025-05-12T09:17:01.000Z","size":10120,"stargazers_count":2022,"open_issues_count":65,"forks_count":207,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-14T22:03:54.731Z","etag":null,"topics":["email","hacktoberfest","mailer","mailer-library","rust","sendmail","smtp"],"latest_commit_sha":null,"homepage":"https://lettre.rs","language":"Rust","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/lettre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"liberapay":"amousset"}},"created_at":"2014-02-03T14:31:40.000Z","updated_at":"2025-05-14T17:59:22.000Z","dependencies_parsed_at":"2023-07-13T23:30:21.074Z","dependency_job_id":"a1ca35f2-eb2f-4920-98b9-a61f1219f6ab","html_url":"https://github.com/lettre/lettre","commit_stats":{"total_commits":1020,"total_committers":98,"mean_commits":"10.408163265306122","dds":0.5274509803921569,"last_synced_commit":"de075153b0152e36ca1f918b38a694325afaaefb"},"previous_names":["amousset/rust-smtp"],"tags_count":66,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettre%2Flettre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettre%2Flettre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettre%2Flettre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettre%2Flettre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lettre","download_url":"https://codeload.github.com/lettre/lettre/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235687,"owners_count":22036962,"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":["email","hacktoberfest","mailer","mailer-library","rust","sendmail","smtp"],"created_at":"2024-07-31T03:01:12.019Z","updated_at":"2025-05-14T22:05:30.048Z","avatar_url":"https://github.com/lettre.png","language":"Rust","funding_links":["https://liberapay.com/amousset"],"categories":["Libraries","Rust","库 Libraries","Code","库","虚拟化"],"sub_categories":["Email","电子邮件 Email","Library","电子邮件","邮件 Email","邮件处理"],"readme":"\u003ch1 align=\"center\"\u003elettre\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n \u003cstrong\u003e\n   A mailer library for Rust\n \u003c/strong\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://docs.rs/lettre\"\u003e\n    \u003cimg src=\"https://docs.rs/lettre/badge.svg\"\n      alt=\"docs\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://crates.io/crates/lettre\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/d/lettre.svg\"\n      alt=\"downloads\" /\u003e\n  \u003c/a\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://gitter.im/lettre/lettre\"\u003e\n    \u003cimg src=\"https://badges.gitter.im/lettre/lettre.svg\"\n      alt=\"chat on gitter\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://lettre.rs\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/visit-website-blueviolet\"\n      alt=\"website\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://deps.rs/crate/lettre/0.11.16\"\u003e\n    \u003cimg src=\"https://deps.rs/crate/lettre/0.11.16/status.svg\"\n      alt=\"dependency status\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n---\n\n## Features\n\nLettre provides the following features:\n\n* Multiple transport methods\n* Unicode support (for email content and addresses)\n* Secure delivery with SMTP using encryption and authentication\n* Easy email builders\n* Async support\n\nLettre does not provide (for now):\n\n* Email parsing\n\n## Supported Rust Versions\n\nLettre supports all Rust versions released in the last 6 months. At the time of writing\nthe minimum supported Rust version is 1.74, but this could change at any time either from\none of our dependencies bumping their MSRV or by a new patch release of lettre.\n\n## Example\n\nThis library requires Rust 1.74 or newer.\nTo use this library, add the following to your `Cargo.toml`:\n\n```toml\n[dependencies]\nlettre = \"0.11\"\n```\n\n```rust,no_run\nuse lettre::message::header::ContentType;\nuse lettre::transport::smtp::authentication::Credentials;\nuse lettre::{Message, SmtpTransport, Transport};\n\nfn main() {\n    let email = Message::builder()\n        .from(\"NoBody \u003cnobody@domain.tld\u003e\".parse().unwrap())\n        .reply_to(\"Yuin \u003cyuin@domain.tld\u003e\".parse().unwrap())\n        .to(\"Hei \u003chei@domain.tld\u003e\".parse().unwrap())\n        .subject(\"Happy new year\")\n        .header(ContentType::TEXT_PLAIN)\n        .body(String::from(\"Be happy!\"))\n        .unwrap();\n\n    let creds = Credentials::new(\"smtp_username\".to_owned(), \"smtp_password\".to_owned());\n\n    // Open a remote connection to gmail\n    let mailer = SmtpTransport::relay(\"smtp.gmail.com\")\n        .unwrap()\n        .credentials(creds)\n        .build();\n\n    // Send the email\n    match mailer.send(\u0026email) {\n        Ok(_) =\u003e println!(\"Email sent successfully!\"),\n        Err(e) =\u003e panic!(\"Could not send email: {e:?}\"),\n    }\n}\n```\n\n## Not sure of which connect options to use?\n\nClone the lettre git repository and run the following command (replacing `SMTP_HOST` with your SMTP server's hostname)\n\n```shell\ncargo run --example autoconfigure SMTP_HOST\n```\n\n## Testing\n\nThe `lettre` tests require an open mail server listening locally on port 2525 and the `sendmail` command. If you have python installed\nsuch a server can be launched with `python -m smtpd -n -c DebuggingServer 127.0.0.1:2525`\n\nAlternatively only unit tests can be run by doing `cargo test --lib`.\n\n## Troubleshooting\n\nThese are general steps to be followed when troubleshooting SMTP related issues.\n\n- Ensure basic connectivity, ensure requisite ports are open and daemons are listening.\n- Confirm that your service provider allows traffic on the ports being used for mail transfer.\n- Check SMTP relay authentication and configuration.\n- Validate your DNS records. (DMARC, SPF, DKIM, MX)\n- Verify your SSL/TLS certificates are setup properly.\n- Investigate if filtering, formatting, or filesize limits are causing messages to be lost, delayed, or blocked by relays or remote hosts.\n\n## Code of conduct\n\nAnyone who interacts with Lettre in any space, including but not limited to\nthis GitHub repository, must follow our [code of conduct](https://github.com/lettre/lettre/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThis program is distributed under the terms of the MIT license.\n\nThe builder comes from [emailmessage-rs](https://github.com/katyo/emailmessage-rs) by\nKayo, under MIT license.\n\nSee [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flettre%2Flettre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flettre%2Flettre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flettre%2Flettre/lists"}