{"id":36444643,"url":"https://github.com/ohmyfate/tempmail","last_synced_at":"2026-01-15T01:57:09.126Z","repository":{"id":236956845,"uuid":"793266771","full_name":"ohmyfate/tempmail","owner":"ohmyfate","description":"💌 A Temporary Email Package for Go Supporting Custom Emails, Attachments, Messages","archived":false,"fork":false,"pushed_at":"2025-12-23T21:17:16.000Z","size":25,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-11T23:49:45.585Z","etag":null,"topics":["go","go-package","go-tempmail-package","golang","gopackage","temp-mail","temp-mail-api","tempmail","tempmail-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ohmyfate.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-28T21:43:37.000Z","updated_at":"2025-12-23T21:17:21.000Z","dependencies_parsed_at":"2024-04-29T12:06:25.648Z","dependency_job_id":null,"html_url":"https://github.com/ohmyfate/tempmail","commit_stats":null,"previous_names":["mixtre/tempmail","notkitsune/tempmail","notjoy/tempmail","notahri/tempmail","itsamaryllis/tempmail","notnerina/tempmail","cloudkissed/tempmail","suchdivinity/tempmail","transvinity/tempmail","nannyvina/tempmail","ohmyfate/tempmail"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ohmyfate/tempmail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmyfate%2Ftempmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmyfate%2Ftempmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmyfate%2Ftempmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmyfate%2Ftempmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ohmyfate","download_url":"https://codeload.github.com/ohmyfate/tempmail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmyfate%2Ftempmail/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28441031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"ssl_error","status_checked_at":"2026-01-15T00:55:20.945Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go","go-package","go-tempmail-package","golang","gopackage","temp-mail","temp-mail-api","tempmail","tempmail-api"],"created_at":"2026-01-11T22:03:33.199Z","updated_at":"2026-01-15T01:57:09.114Z","avatar_url":"https://github.com/ohmyfate.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"**TempMail Package**\n=====================\n\nThe `tempmail` package provides a simple way to interact with temporary email services. It allows you to create a temporary email address, retrieve emails, and extract information from them.\n\n**Getting Started**\n-------------------\n\nTo use the `tempmail` package, you need to import it in your Go program:\n```go\nimport \"github.com/NannyVina/tempmail\"\n```\n**Creating a Temporary Email Address**\n-------------------------------------\n\nTo create a temporary email address, you need to specify an alias and a domain. The `TempMail` function returns a `*Mail` struct that represents the temporary email address:\n```go\nfunc TempMail(alias string, domain string) (*Mail, error)\n```\n* `alias`: The alias for the temporary email address (e.g. \"myalias\")\n* `domain`: The domain for the temporary email address (e.g. `tempmail.MailtoPlus`, `tempmail.FexpostCom`, etc.)\n\nAvailable domains:\n\n* `tempmail.MailtoPlus`\n* `tempmail.FexpostCom`\n* `tempmail.FexboxOrg`\n* `tempmail.MailboxInUa`\n* `tempmail.RoverInfo`\n* `tempmail.ChitthiIn`\n* `tempmail.FextempCom`\n* `tempmail.AnyPink`\n* `tempmail.MerepostCom`\n\nExample:\n```go\nmail, err := tempmail.TempMail(\"myalias\", tempmail.MailtoPlus)\nif err!= nil {\n    log.Fatal(err)\n}\n```\n**Printing the Temporary Email Address**\n--------------------------------------\n\nYou can print the temporary email address using the `String()` method of the `Mail` struct:\n```go\nfmt.Println(\"Temporary Email Address:\", mail.String())\n```\nThis will output the temporary email address in the format `alias@domain`.\n\n**Retrieving Emails**\n--------------------\n\nTo retrieve emails, you can use the `GetMails` method of the `Mail` struct. It returns a `MailResponse` struct that contains a list of emails:\n```go\nfunc (mail *Mail) GetMails() *MailResponse\n```\nNo parameters are required for this function.\n\nExample:\n```go\nmailResponse := mail.GetMails()\nif mailResponse == nil {\n    log.Fatal(\"Error retrieving emails\")\n}\nfmt.Println(mailResponse)\n```\n**Getting Email IDs**\n---------------------\n\nTo get the IDs of the emails, you can iterate over the `MailList` field of the `MailResponse` struct:\n```go\nfor _, email := range mailResponse.MailList {\n    fmt.Println(\"Email ID:\", email.MailID)\n}\n```\n**Extracting Information from Emails**\n-------------------------------------\n\nYou can extract information from emails using the `GetMail` method of the `Mail` struct. It returns a `MailDetail` struct that contains information about the email:\n```go\nfunc (mail *Mail) GetMail(id int) *MailDetail\n```\n* `id`: The ID of the email to retrieve (e.g. 123)\n\nExample:\n```go\nmailDetail := mail.GetMail(123)\nif mailDetail == nil {\n    log.Fatal(\"Error retrieving email\")\n}\n```\nYou can extract the following information from the `MailDetail` struct:\n\n* `Subject`: The subject of the email\n* `From`: The sender of the email\n* `To`: The recipient of the email\n* `Text`: The text content of the email\n* `Html`: The HTML content of the email\n* `Attachments`: A list of attachments\n* `Date`: The date the email was received\n\n**Printing the Email Content**\n-----------------------------\n\nYou can print the email content using the `String()` method of the `MailDetail` struct:\n```go\nfmt.Println(\"Email Content:\")\nfmt.Println(\"Subject:\", mailDetail.Subject)\nfmt.Println(\"From:\", mailDetail.From)\nfmt.Println(\"To:\", mailDetail.To)\nfmt.Println(\"Text:\", mailDetail.Text)\nfmt.Println(\"Html:\", mailDetail.Html)\nfmt.Println(\"Attachments:\")\nfor _, attachment := range mailDetail.Attachments {\n    fmt.Println(\"Attachment ID:\", attachment.AttachmentID)\n    fmt.Println(\"Attachment Name:\", attachment.Name)\n}\n```\nThis will output the email content in a human-readable format.\n\n**Getting Attachment IDs**\n-------------------------\n\nTo get the IDs of the attachments, you can iterate over the `Attachments` field of the `MailDetail` struct:\n```go\nfor _, attachment := range mailDetail.Attachments {\n    fmt.Println(\"Attachment ID:\", attachment.AttachmentID)\n}\n```\n**Extracting Attachments**\n-------------------------\n\nYou can extract attachments from emails using the `GetAttachmentLink` method of the `Mail` struct. It returns a URL that you can use to download the attachment:\n```go\nfunc (mail *Mail) GetAttachmentLink(AttachmentID int, attachments []Attachment, MailID int) string\n```\n* `AttachmentID`: The ID of the attachment to retrieve (e.g. 123)\n* `attachments`: A list of attachments for the email\n* `MailID`: The ID of the email that the attachment belongs to (e.g. 123)\n\nExample:\n```go\nattachmentLink := mail.GetAttachmentLink(123, mailDetail.Attachments, 123)\nif attachmentLink == \"\" {\n    log.Fatal(\"Error retrieving attachment link\")\n}\nfmt.Println(\"Attachment Link:\", attachmentLink)\n```\nThis will output the URL of the attachment.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohmyfate%2Ftempmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fohmyfate%2Ftempmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohmyfate%2Ftempmail/lists"}