{"id":29251701,"url":"https://github.com/macrat/json2mail","last_synced_at":"2025-07-04T01:08:13.018Z","repository":{"id":104355859,"uuid":"399398614","full_name":"macrat/json2mail","owner":"macrat","description":"Send many emails from JSON data","archived":false,"fork":false,"pushed_at":"2024-05-27T03:00:15.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-21T06:52:37.763Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/macrat.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}},"created_at":"2021-08-24T08:56:41.000Z","updated_at":"2024-05-27T02:58:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"7514f035-b0f9-49a5-b89a-5ff39c256deb","html_url":"https://github.com/macrat/json2mail","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/macrat/json2mail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fjson2mail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fjson2mail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fjson2mail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fjson2mail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/macrat","download_url":"https://codeload.github.com/macrat/json2mail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fjson2mail/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263427316,"owners_count":23464845,"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":"2025-07-04T01:08:11.670Z","updated_at":"2025-07-04T01:08:12.999Z","avatar_url":"https://github.com/macrat.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"JSON To Mail\r\n============\r\n\r\nSend emails from JSON data.\r\n\r\n## Get started\r\n\r\n1. Download latest binary from [download page](https://github.com/macrat/json2mail/releases).\r\n\r\n2. Write emails as JSON.\r\n\r\n   ```json\r\n   [{\r\n     \"to\": \"\\\"someone\\\" \u003cdestination@example.com\u003e\",\r\n     \"from\": \"\\\"your name\\\" \u003cyou@example.com\u003e\",\r\n     \"subject\": \"test mail\",\r\n     \"body\": \"hello!\\nthis is a test\"\r\n   }]\r\n   ```\r\n\r\n3. Send emails using `json2email` command\r\n\r\n   ```shell\r\n   $ cat emails.json | json2mail -server smtp.example.com -username you@example.com -password your_p@ssword\r\n   ```\r\n\r\n\r\n## Options\r\n\r\njson2mail supports following options.\r\n\r\nSome of them can be set by the environment variable.\r\nIf set by both ways, the command-line options will be used.\r\n\r\n| Command-line               | Environment variable | Description                                                                         |\r\n|----------------------------|----------------------|-------------------------------------------------------------------------------------|\r\n| **-server** *[ADDRESS]*    | JSON2MAIL_SERVER     | SMTP server address.\u003cbr /\u003ee.g. smtp.example.com                                     |\r\n| **-username** *[USERNAME]* | JSON2MAIL_USERNAME   | Your username to login to the SMTP server.                                          |\r\n| **-password** *[PASSWORD]* | JSON2MAIL_PASSWORD   | Your password to login to the SMTP server.                                          |\r\n| **-source** *[FILE]*       |                      | Path of JSON file that including email data.\u003cbr /\u003e(\"-\" or \"\" means read from stdin) |\r\n| **-interval** *[DURATION]* |                      | Interval to send each emails.\u003cbr /\u003ee.g. `100ms`, `1s`, or `1.5s`                    |\r\n| **-allow-insecure**        |                      | Allow to connect without encryption. (NOT recommended)*                             |\r\n| **-dry-run**               |                      | Run json2mail without server connection. It's convinient for testing JSON source.   |\r\n\r\n\r\n## Source format\r\n\r\nYou can write emails as JSON data.\r\n\r\nThe JSON data should be an object, an array of objects, or objects delimited by new-lines.\r\nEach object, means each emails, can include the following fields.\r\n\r\n| Field           | Type                       | Description                                      |\r\n|-----------------|----------------------------|--------------------------------------------------|\r\n| **to**          | String or Array-of-Strings | To address. This is the only required field.     |\r\n| **cc**          | String or Array-of-Strings | CC address.                                      |\r\n| **bcc**         | String or Array-of-Strings | BCC address.                                     |\r\n| **from**        | String                     | From address.                                    |\r\n| **subject**     | String                     | Subject of the email.                            |\r\n| **body**        | String                     | Body of the email. (HTML body is not supported.) |\r\n| **attachments** | String or Array-of-String  | Attachment file paths.                           |\r\n\r\n### Examples\r\n\r\nA simplest email looks like this.\r\n\r\n```json\r\n{\r\n  \"to\": \"destination@example.com\",\r\n  \"from\": \"you@example.com\",\r\n  \"subject\": \"test mail\",\r\n  \"body\": \"hello!\\nthis is a test\"\r\n}\r\n```\r\n\r\nYou can send multiple emails as array.\r\n\r\n```json\r\n[\r\n  {\r\n    \"to\": \"\\\"someone\\\" \u003cdestination@example.com\u003e\",\r\n    \"from\": \"\\\"your name\\\" \u003cyou@example.com\u003e\",\r\n    \"subject\": \"test mail\",\r\n    \"body\": \"hello!\\nthis is a test\"\r\n  },\r\n  {\r\n    \"to\": [\"alice@example.com\", \"bob@example.com\"],\r\n    \"cc\": [\"charlie@example.com\"],\r\n    \"subject\": \"hello\",\r\n    \"body\": \"Hi!\\n\\nIt's a test!\"\r\n  }\r\n]\r\n```\r\n\r\nOr, you can just write multiple emails in a file without array.\r\n\r\n```json\r\n{\r\n  \"to\": \"\\\"someone\\\" \u003cdestination@example.com\u003e\",\r\n  \"from\": \"\\\"your name\\\" \u003cyou@example.com\u003e\",\r\n  \"subject\": \"test mail\",\r\n  \"body\": \"hello!\\nthis is a test\"\r\n}\r\n{\r\n  \"to\": [\"alice@example.com\", \"bob@example.com\"],\r\n  \"cc\": [\"charlie@example.com\"],\r\n  \"subject\": \"hello\",\r\n  \"body\": \"Hi!\\n\\nIt's a test!\"\r\n}\r\n```\r\n\r\n\r\n## Hints\r\n\r\n- In Windows, multi-byte emails can be broken if using stdin. So please try to write to a file in UTF-8, and then use `-source` option.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacrat%2Fjson2mail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacrat%2Fjson2mail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacrat%2Fjson2mail/lists"}