{"id":15374216,"url":"https://github.com/moteus/lua-sendmail","last_synced_at":"2025-10-26T09:38:34.956Z","repository":{"id":4634019,"uuid":"5778574","full_name":"moteus/lua-sendmail","owner":"moteus","description":"Simple wrapper around luasoket smtp.send","archived":false,"fork":false,"pushed_at":"2021-08-28T08:09:13.000Z","size":68,"stargazers_count":32,"open_issues_count":1,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-11T19:39:22.304Z","etag":null,"topics":["email","lua","smtp"],"latest_commit_sha":null,"homepage":null,"language":"CMake","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/moteus.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}},"created_at":"2012-09-12T10:57:28.000Z","updated_at":"2025-07-03T04:39:22.000Z","dependencies_parsed_at":"2022-09-01T17:02:14.166Z","dependency_job_id":null,"html_url":"https://github.com/moteus/lua-sendmail","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/moteus/lua-sendmail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-sendmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-sendmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-sendmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-sendmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moteus","download_url":"https://codeload.github.com/moteus/lua-sendmail/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-sendmail/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281086021,"owners_count":26441337,"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","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","lua","smtp"],"created_at":"2024-10-01T13:57:48.540Z","updated_at":"2025-10-26T09:38:34.912Z","avatar_url":"https://github.com/moteus.png","language":"CMake","readme":"lua-sendmail\r\n============\r\n[![Licence](http://img.shields.io/badge/Licence-MIT-brightgreen.svg)](LICENCE.txt)\r\n\r\nSimple wrapper around luasoket smtp.send.\u003cbr/\u003e\r\nSee [documentation](http://moteus.github.io/sendmail/index.html).\r\n\r\n## Usage\r\n\r\n```Lua\r\nlocal sendmail = require \"sendmail\"\r\nlocal from, to, server = 'from@some.mail', 'to@some.mail', '127.0.0.1'\r\n\r\nsendmail(from, to, server, {\"Subject\", [[\r\n  This is mail body.\r\n]],\r\n  file = {\r\n    name = 'message.txt';\r\n    data = 'file content';\r\n  };\r\n})\r\n```\r\n\r\n### Send mail with SSL/TLS connection (using LuaSec)\r\n```Lua\r\nsendmail{\r\n  server = {\r\n    ssl = {\r\n      protocol = \"sslv3\",\r\n      verify   = {\"peer\", \"fail_if_no_peer_cert\"},\r\n      options  = {\"all\", \"no_sslv2\"},\r\n    },\r\n    address  = ...;\r\n    user     = ...;\r\n    password = ...;\r\n  },\r\n  ...\r\n}\r\n```\r\n\r\n### Send mail with SSL/TLS connection (using custom SSL connection)\r\n```Lua\r\n-- I use lua-lluv-ssl library.\r\nlocal ut     = require \"lluv.utils\"\r\nlocal ssl    = require \"lluv.ssl\"\r\nlocal socket = require \"lluv.ssl.luasocket\"\r\n\r\n-- this is asyncronus call\r\nut.corun(sendmail, {\r\n  server = {\r\n    ssl = ssl.context{\r\n      protocol = \"sslv3\",\r\n      verify   = {\"peer\", \"fail_if_no_peer_cert\"},\r\n      options  = {\"all\", \"no_sslv2\"},\r\n    },\r\n    create = socket.ssl;\r\n    address  = ...;\r\n    user     = ...;\r\n    password = ...;\r\n  },\r\n  ...\r\n})\r\n```\r\n\r\n### Send attached files as single zip archive\r\n```Lua\r\nlocal ZipWriter = require \"ZipWriter\"\r\n\r\nsendmail{\r\n  ...\r\n  message = {\r\n    ...\r\n    file = {\r\n      source = ZipWriter.source(ZipWriter.new(), {\r\n        {\"file01.txt\", \"path/to/file01.txt\"},\r\n        {\"file02.txt\", \"path/to/file02.txt\"},\r\n      }),\r\n      name = 'files.zip';\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n\r\n## Dependences\r\n* [LuaSocket](https://luarocks.org/modules/luarocks/luasocket)\r\n* [LuaSec](https://luarocks.org/modules/brunoos/luasec) - to support SMTPS protocol\r\n* [Lua-cURL](https://luarocks.org/modules/moteus/lua-curl) - can be used to handle SMTP(S) protocol and IO. Still require LuaSocket to build message itself\r\n\r\n","funding_links":[],"categories":["Email"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoteus%2Flua-sendmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoteus%2Flua-sendmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoteus%2Flua-sendmail/lists"}