{"id":17526475,"url":"https://github.com/chuccp/smtp2http","last_synced_at":"2025-03-06T06:30:31.277Z","repository":{"id":249463908,"uuid":"796466846","full_name":"chuccp/smtp2http","owner":"chuccp","description":"SMTP to HTTP, Send emails over  HTTP ,  manage SMTP and email addresses via a web page..通过http接口来发送邮件，以web页面方式管理SMTP以及邮箱地址","archived":false,"fork":false,"pushed_at":"2024-10-16T15:13:54.000Z","size":429,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-19T01:48:28.218Z","etag":null,"topics":["api","http","mail","smtp","smtp-client","smtp-to-http","smtp2http","stmp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chuccp.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-05-06T01:57:01.000Z","updated_at":"2024-10-16T15:13:58.000Z","dependencies_parsed_at":"2024-07-30T09:02:49.179Z","dependency_job_id":"d1b44340-15d0-47e6-9517-b6ac4247fdf3","html_url":"https://github.com/chuccp/smtp2http","commit_stats":null,"previous_names":["chuccp/d-mail","chuccp/smtp2http"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuccp%2Fsmtp2http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuccp%2Fsmtp2http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuccp%2Fsmtp2http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuccp%2Fsmtp2http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chuccp","download_url":"https://codeload.github.com/chuccp/smtp2http/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242161167,"owners_count":20081818,"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":["api","http","mail","smtp","smtp-client","smtp-to-http","smtp2http","stmp"],"created_at":"2024-10-20T15:01:48.787Z","updated_at":"2025-03-06T06:30:30.919Z","avatar_url":"https://github.com/chuccp.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"**English**🌎 | [**简体中文**🀄](./README_zh.md)\n\nIn the project, emails are often used to notify exception logs. However, this usually requires configuring SMTP within the project and providing the email address for receiving emails. When the email address changes, it necessitates modifying the project's configuration file. Additionally, due to network restrictions, it may be impossible to configure SMTP.\n\nThis program can replace SMTP with an HTTP interface, simplifying the process of sending emails. You only need to configure SMTP and the email address for receiving emails on the management page to achieve email sending via HTTP.\n\nSupports GET and POST requests.\n\n**GET Request Example**:\n\n```powershell\ncurl 'http://127.0.0.1:12567/sendMail?token={{token}}\u0026content=this%20is%20a%20test\u0026recipients=aaa@mail.com,bbb@mail.com'\n```\n\n**POST Request Example**:\n\n```powershell\ncurl -X POST 'http://127.0.0.1:12567/sendMail' \\\n--header 'Content-Type: application/x-www-form-urlencoded' \\\n--data-urlencode 'token={{token}}' \\\n--data-urlencode 'content=this%20is%20a%20test'\n```\n\n**Example of Sending an Email with Attachments**:\n\n```powershell\ncurl -X POST 'http://127.0.0.1:12567/sendMail' \\\n--form 'files=@\"/111111.txt\"' \\\n--form 'files=@\"/22222222222222.txt\"' \\\n--form 'token={{token}}\"' \\\n--form 'content=1212'\n```\nThis method is essentially a simple form submission, making it easy for different languages and platforms to use this project.\n\n**POST submission json format example**:\n```powershell\ncurl -X POST 'http://127.0.0.1:12567/sendMail' \\\n--header 'Content-Type: application/json' \\\n--data '{\n\"token\": \"{{token}}\",\n\"content\":\"this is a test\",\n\"recipients\":[\"aaa@mail.com\",\"bbb@mail.com\"]\n}'\n```\n\n\n**Parameter Description**:\n\n- `token`: Manually added in the management interface, it is the unique value bound with SMTP and the receiving email address.\n- `content`: The content of the email.\n- `subject`: The subject of the email. If a subject is set when the token is generated, it will be used as the default subject if this parameter is empty.\n- `files`: The attachments to be sent, supports multiple files.\n- `recipients`: Supplementary email address, optional.\n\n**Install Method**:\n\nYou can directly download the compiled version from the following link:\n\n[Download from GitHub](https://github.com/chuccp/smtp2http/releases)\n\nor\n\n```\ncurl -uri \"https://github.com/chuccp/smtp2http/releases/latest/download/smtp2http-windows-amd64.tar.gz\" -o smtp2http-windows-amd64.tar.gz\n```\n\ndocker Images\n```\ndocker pull cooge123/smtp2http\n\ndocker run -p 12566:12566 -p 12567:12567 -it --rm cooge123/smtp2http\n```\n\n\nAfter downloading and extracting, you can run it directly. The default port number is 12566. After the program runs, it will generate a configuration file where you can modify the port number. After modification, restart the program to use the new port number.\n\nAfter starting, you can enter the management interface by opening a browser to `http://127.0.0.1:12566`.\n\n**Configuration File Description**:\n\nAfter the program runs, it automatically generates a configuration file, including the following sections:\n\n```\n[core]\ninit      = true   # Whether initialization is complete, default is false\ncachePath = .cache  # Temporary cache path for email sending files\ndbType    = sqlite  # Database type, currently supports sqlite and mysql\n\n[sqlite]\nfilename = d-mail.db  # SQLite file path\n\n[manage]\nport     = 12566      # Port number for backend management\nusername = 111111     # Backend management account\npassword = 111111     # Backend management password\nwebPath  = web        # Static file path\n\n[api]\nport = 12566          # Port number for sending emails, if you do not want to share the port number with the management backend, you can change it to another port number\n\n[mysql]\nhost     = 127.0.0.1  # MySQL host address\nport     = 3306       # MySQL port number\ndbname   = d_mail     # MySQL database name\ncharset  = utf8       # Encoding format, default is utf8\nusername = root       # MySQL account\npassword = 123456     # MySQL password\n```\n\n---\n\n**Compilation Instructions**:\n\nIf you wish to compile the project yourself, you will need to compile not only this project but also the web page found at https://github.com/chuccp/d-mail-view.\n\n\n**Software Operation**:\n\nWhen you first enter the management backend, you need to configure the database and the backend management account. Currently, SQLite and MySQL databases are supported.\n\n![initial](https://github.com/chuccp/smtp2http/blob/main/image/0001.png?raw=true \"Initial Configuration\")\n\nAdd SMTP address:\n\n![SMTP Configuration](https://github.com/chuccp/smtp2http/blob/main/image/0002.png?raw=true \"SMTP Configuration\")\n\nAdd the email address for receiving emails:\n\n![Mail Configuration](https://github.com/chuccp/smtp2http/blob/main/image/0003.png?raw=true \"Mail Configuration\")\n\nAdd Token:\n\n![Token Configuration](https://github.com/chuccp/smtp2http/blob/main/image/0004.png?raw=true \"Token Configuration\")\n\nAfter the configuration is complete, you can use the Token to send messages to the email.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuccp%2Fsmtp2http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchuccp%2Fsmtp2http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuccp%2Fsmtp2http/lists"}