{"id":18818674,"url":"https://github.com/mailosaur/mailosaur-go","last_synced_at":"2026-03-15T10:43:37.799Z","repository":{"id":45314329,"uuid":"347169293","full_name":"mailosaur/mailosaur-go","owner":"mailosaur","description":"Mailosaur email and SMS testing library for Go","archived":false,"fork":false,"pushed_at":"2025-01-02T09:41:37.000Z","size":358,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T22:02:53.444Z","etag":null,"topics":["email","email-testing","end-to-end-testing","golang","qa","qaautomation","sms","testing-tools"],"latest_commit_sha":null,"homepage":"https://mailosaur.com/docs/languages/go/","language":"Go","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/mailosaur.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":"2021-03-12T18:59:52.000Z","updated_at":"2025-03-19T21:48:14.000Z","dependencies_parsed_at":"2025-01-02T10:31:23.342Z","dependency_job_id":"1759c785-46ff-44ea-a4dc-51e9bdc92d5c","html_url":"https://github.com/mailosaur/mailosaur-go","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailosaur%2Fmailosaur-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailosaur%2Fmailosaur-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailosaur%2Fmailosaur-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailosaur%2Fmailosaur-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mailosaur","download_url":"https://codeload.github.com/mailosaur/mailosaur-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248796915,"owners_count":21163051,"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","email-testing","end-to-end-testing","golang","qa","qaautomation","sms","testing-tools"],"created_at":"2024-11-08T00:17:44.948Z","updated_at":"2026-03-15T10:43:37.792Z","avatar_url":"https://github.com/mailosaur.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Mailosaur - Go library](https://mailosaur.com/) \u0026middot; [![](https://github.com/mailosaur/mailosaur-go/workflows/CI/badge.svg)](https://github.com/mailosaur/mailosaur-go/actions)\n\nMailosaur lets you automate email and SMS tests as part of software development and QA.\n\n- **Unlimited test email addresses for all**  - every account gives users an unlimited number of test email addresses to test with.\n- **End-to-end (e2e) email and SMS testing** Allowing you to set up end-to-end tests for password reset emails, account verification processes and MFA/one-time passcodes sent via text message.\n- **Fake SMTP servers** Mailosaur also provides dummy SMTP servers to test with; allowing you to catch email in staging environments - preventing email being sent to customers by mistake.\n\n## Get Started\n\nThis guide provides several key sections:\n\n- [Mailosaur - Go library · ](#mailosaur---go-library--)\n  - [Get Started](#get-started)\n    - [Installation](#installation)\n    - [Set your API key](#set-your-api-key)\n    - [Create your code](#create-your-code)\n    - [API Reference](#api-reference)\n  - [Creating an account](#creating-an-account)\n  - [Test email addresses with Mailosaur](#test-email-addresses-with-mailosaur)\n  - [Usage](#usage)\n  - [Development](#development)\n  - [Contacting us](#contacting-us)\n\nYou can find the full [Mailosaur documentation](https://mailosaur.com/docs/) on the website.\n\nIf you get stuck, just contact us at support@mailosaur.com.\n\n### Installation\n\n```sh\ngo mod init\n```\n\nThen, reference mailosaur-go via `import`:\n\n```golang\nimport (\n    \"github.com/mailosaur/mailosaur-go\"\n)\n```\n\nAlternatively, you can also `go get` the package into your project:\n\n```sh\ngo get -u github.com/mailosaur/mailosaur-go\n```\n\n### Set your API key\n\nGet your API key from the Mailosaur Dashboard and set it as an environment variable:\n\n```sh\nexport MAILOSAUR_API_KEY='your-api-key-here'\n```\n\n### Create your code\n\nNow import the library and create a client:\n\n```golang\nimport (\n    \"github.com/mailosaur/mailosaur-go\"\n)\n\nm := mailosaur.New()\n```\n\n### API Reference\n\nThis library is powered by the Mailosaur [email \u0026 SMS testing API](https://mailosaur.com/docs/api/). You can easily check out the API itself by looking at our [API reference documentation](https://mailosaur.com/docs/api/) or via our Postman or Insomnia collections:\n\n[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/6961255-6cc72dff-f576-451a-9023-b82dec84f95d?action=collection%2Ffork\u0026collection-url=entityId%3D6961255-6cc72dff-f576-451a-9023-b82dec84f95d%26entityType%3Dcollection%26workspaceId%3D386a4af1-4293-4197-8f40-0eb49f831325)\n [![Run in Insomnia}](https://insomnia.rest/images/run.svg)](https://insomnia.rest/run/?label=Mailosaur\u0026uri=https%3A%2F%2Fmailosaur.com%2Finsomnia.json)\n\n## Creating an account\n\nCreate a [free trial account](https://mailosaur.com/app/signup) for Mailosaur via the website.\n\nOnce you have this, navigate to the [API tab](https://mailosaur.com/app/project/api) to find the following values:\n\n- **Server ID** - Servers act like projects, which group your tests together. You need this ID whenever you interact with a server via the API.\n- **Server Domain** - Every server has its own domain name. You'll need this to send email to your server.\n- **API Key** - You can create an API key per server (recommended), or an account-level API key to use across your whole account. [Learn more about API keys](https://mailosaur.com/docs/managing-your-account/api-keys/).\n\n## Test email addresses with Mailosaur\n\nMailosaur gives you an **unlimited number of test email addresses** - with no setup or coding required!\n\nHere's how it works:\n\n* When you create an account, you are given a server.\n* Every server has its own **Server Domain** name (e.g. `abc123.mailosaur.net`)\n* Any email address that ends with `@{YOUR_SERVER_DOMAIN}` will work with Mailosaur without any special setup. For example:\n  * `build-423@abc123.mailosaur.net`\n  * `john.smith@abc123.mailosaur.net`\n  * `rAnDoM63423@abc123.mailosaur.net`\n* You can create more servers when you need them. Each one will have its own domain name.\n\n***Can't use test email addresses?** You can also [use SMTP to test email](https://mailosaur.com/docs/email-testing/sending-to-mailosaur/#sending-via-smtp). By connecting your product or website to Mailosaur via SMTP, Mailosaur will catch all email your application sends, regardless of the email address.*\n\n## Usage\n\nexample_test.go\n\n```golang\npackage emailtests\n\nimport (\n  \"fmt\"\n  \"testing\"\n  \"github.com/mailosaur/mailosaur-go\"\n)\n\nfunc TestExample(t *testing.T) {\n  serverId := \"SERVER_ID\";\n  serverDomain := \"SERVER_DOMAIN\";\n\n  m := mailosaur.New();\n\n  params := \u0026mailosaur.MessageSearchParams {\n    Server: serverId,\n  }\n\n  criteria := \u0026mailosaur.SearchCriteria {\n    SentTo: \"anything@\" + serverDomain,\n  }\n\n  email, err := m.Messages.Get(params, criteria)\n\n  if (err != nil) {\n    t.Error(err)\n  }\n\n  // If we have an email, print the subject\n  fmt.Println(\"Subject: \" + email.Subject)\n}\n```\n\n## Development\n\nThe test suite requires the following environment variables to be set:\n\n```sh\nexport MAILOSAUR_API_KEY=your_api_key\nexport MAILOSAUR_SERVER=server_id\n```\n\nRun all tests:\n\n```sh\ngo test -v\n```\n\n## Contacting us\n\nYou can get us at [support@mailosaur.com](mailto:support@mailosaur.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmailosaur%2Fmailosaur-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmailosaur%2Fmailosaur-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmailosaur%2Fmailosaur-go/lists"}