{"id":22822991,"url":"https://github.com/haskell-github-trust/smtp-mail","last_synced_at":"2025-04-23T03:48:22.865Z","repository":{"id":230311510,"uuid":"779069390","full_name":"haskell-github-trust/smtp-mail","owner":"haskell-github-trust","description":"Simple email sending via SMTP","archived":false,"fork":false,"pushed_at":"2025-04-19T04:43:29.000Z","size":101,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-23T03:48:17.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hackage.haskell.org/package/smtp-mail","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haskell-github-trust.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":"2024-03-29T01:13:17.000Z","updated_at":"2025-04-19T04:43:31.000Z","dependencies_parsed_at":"2024-04-02T16:32:20.944Z","dependency_job_id":"33d0e25a-5a65-49ca-91f7-0a396b919eac","html_url":"https://github.com/haskell-github-trust/smtp-mail","commit_stats":null,"previous_names":["haskell-github-trust/smtp-mail"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-github-trust%2Fsmtp-mail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-github-trust%2Fsmtp-mail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-github-trust%2Fsmtp-mail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-github-trust%2Fsmtp-mail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haskell-github-trust","download_url":"https://codeload.github.com/haskell-github-trust/smtp-mail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250366681,"owners_count":21418768,"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":[],"created_at":"2024-12-12T16:13:55.673Z","updated_at":"2025-04-23T03:48:22.849Z","avatar_url":"https://github.com/haskell-github-trust.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"SMTP-MAIL\n=========\n\nMaking it easy to send SMTP emails from Haskell.\n\n```\ncabal install smtp-mail\n```\n\n### Sending with an SMTP server\n\n```haskell\n{-# LANGUAGE OverloadedStrings #-}\n\nimport Network.Mail.SMTP\n\nfrom       = Address Nothing \"email@domain.com\"\nto         = [Address (Just \"Jason Hickner\") \"email@domain.com\"]\ncc         = []\nbcc        = []\nsubject    = \"email subject\"\nbody       = plainTextPart \"email body\"\nhtml       = htmlPart \"\u003ch1\u003eHTML\u003c/h1\u003e\"\n\nmail = simpleMail from to cc bcc subject [body, html]\n\nmain = sendMail host mail\n```\n\nor with an attachment:\n\n```haskell\nmain = do\n  attachment \u003c- filePart \"application/octet-stream\" \"path/to/attachment.zip\"\n  let mail = simpleMail from to cc bcc subject [body, html, attachment]\n  sendMail host mail\n```\n\nor, with authentication:\n\n```haskell\nmain = sendMailWithLogin host user pass mail\n```\n\nor, using STARTTLS:\n\n```haskell\nmain = sendMailSTARTTLS host mail\n```\n\nor, using SMTPS:\n\n```haskell\nmain = sendMailTLS host mail\n```\n\nNote: `sendMail'` and `sendMailWithLogin'` variations are also provided if you want to specify a port as well as a hostname.\n\n\n### Sending with sendmail\n\nIf you'd like to use sendmail, the sendmail interface from ```Network.Mail.Mime``` \nis reexported as well:\n\n```haskell\n-- send via the default sendmail executable with default options\nrenderSendMail mail\n\n-- send via the specified executable with specified options\nrenderSendMailCustom filepath [opts] mail\n```\n\nFor more complicated scenarios or for adding attachments or CC/BCC\naddresses you can import ```Network.Mail.Mime``` and construct ```Mail```\nobjects manually.\n\n### Thanks\n\nThis library is based on code from HaskellNet, which appears to be no longer\nmaintained. I've cleaned up the error handling, added some API functions to\nmake common operations easier, and switched to ByteStrings where applicable.\n\n### Developing\n\n`nix-integration-test/` contains a integration test, which\nuses nixos qemu vm tests to start a qemu vm with a postfix and use smtp-mail to\nsend mails to that postfix.\n\nInstall [nix](https://nixos.org), enable [flakes](https://nixos.wiki/wiki/Flakes) and execute\n`nix flake check` to execute the test. Success is signalled by a return code of `0`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell-github-trust%2Fsmtp-mail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaskell-github-trust%2Fsmtp-mail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell-github-trust%2Fsmtp-mail/lists"}