{"id":13776198,"url":"https://github.com/alexcesaro/mail","last_synced_at":"2025-03-17T05:32:15.544Z","repository":{"id":57482604,"uuid":"21229586","full_name":"alexcesaro/mail","owner":"alexcesaro","description":"Deprecated use Gomail instead.","archived":false,"fork":false,"pushed_at":"2014-10-15T15:51:44.000Z","size":321,"stargazers_count":83,"open_issues_count":0,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-02-15T07:33:56.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/go-gomail/gomail","language":"Go","has_issues":false,"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/alexcesaro.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}},"created_at":"2014-06-26T05:50:37.000Z","updated_at":"2023-06-23T21:46:53.000Z","dependencies_parsed_at":"2022-09-02T06:20:58.356Z","dependency_job_id":null,"html_url":"https://github.com/alexcesaro/mail","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcesaro%2Fmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcesaro%2Fmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcesaro%2Fmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcesaro%2Fmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexcesaro","download_url":"https://codeload.github.com/alexcesaro/mail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243846976,"owners_count":20357294,"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":"2024-08-03T18:00:18.954Z","updated_at":"2025-03-17T05:32:14.979Z","avatar_url":"https://github.com/alexcesaro.png","language":"Go","funding_links":[],"categories":["Email"],"sub_categories":["Middlewares"],"readme":"# Deprecated\n\nThis package is deprecated, use these new repositories instead:\n * Gomail: https://github.com/go-gomail/gomail\n * quotedprintable: https://github.com/alexcesaro/quotedprintable\n * mailer has been merged into Gomail\n\nThe new version of Gomail has new features, better performances and a simpler\nAPI!\n\nHere is the list of breaking changes and how to update your code:\n\n## Import\n\nBefore:\n\n    import \"github.com/alexcesaro/mail/gomail\"\n\nAfter:\n\n    import \"gopkg.in/gomail.v1\"\n\n\n## Add*Header functions\n\nFunctions AddHeader, AddAddressHeader and AddDateHeader were removed.\n\nBefore:\n\n    msg.SetHeader(\"To\", \"alex@example.com\")\n    msg.AddHeader(\"To\", \"bob@example.com\")\n\nAfter:\n\n    msg.SetHeader(\"From\", \"alex@example.com\", \"bob@example.com\")\n\nTo replace AddAddressHeader and AddDateHeader you can use the new functions FormatAddress and FormatDate with SetHeader or SetHeaders.\n\n\n## Attach a file\n\nBefore:\n\n    if err := msg.Attach(\"/home/Alex/lolcat.jpg\"); err != nil {\n        panic(err)\n    }\n\nAfter:\n\n    f, err := gomail.OpenFile(\"/home/Alex/lolcat.jpg\")\n    if err != nil {\n        panic(err)\n    }\n    msg.Attach(f)\n\n\n## NewCustomMessage\n\nBefore:\n\n    msg := NewMessage(\"ISO-8859-1\", Base64)\n\nAfter:\n\n    msg := NewMessage(SetCharset(\"ISO-8859-1\"), SetEncoding(Base64))\n\n\n## Export\n\nBefore:\n\n    m, err := msg.Export()\n    if err != nil {\n        panic(err)\n    }\n\nAfter:\n\n    m := msg.Export()\n\n\n## Constants\n\nConstants `QuotedPrintable` and `Base64` had type `string` and now have type\n`Encoding`. If you just used these constants in NewCustomMessage there is\nnothing to do.\n\n\n----\n\nThis repository contains mail packages for Go:\n - [gomail](#gomail) is the main package of this repository, it provides a\n   simple interface to easily write and send emails.\n - [mailer](#mailer) provides functions to easily send emails. It should be used\n   with or inside a package that helps writing emails like it is done in gomail.\n - [quotedprintable](#quotedprintable) is a package that implements\n   quoted-printable and message header encoding. Someday, it might enter the Go\n   standard library.\n\nYou are more than welcome to ask questions on the [Go mailing-list](https://groups.google.com/d/topic/golang-nuts/ywPpNlmSt6U/discussion) and open issues here if you find bugs.\n\n\n# gomail\n\n[Documentation](http://godoc.org/github.com/alexcesaro/mail/gomail)\n\nPackage gomail provides a simple interface to easily write and send emails.\n\nExample:\n\n    package main\n\n    import (\n        \"log\"\n\n        \"github.com/alexcesaro/mail/gomail\"\n    )\n\n    func main() {\n        msg := gomail.NewMessage()\n        msg.SetAddressHeader(\"From\", \"alex@example.com\", \"Alex\")\n        msg.SetHeader(\"To\", \"bob@example.com\")\n        msg.AddHeader(\"To\", \"cora@example.com\")\n        msg.SetHeader(\"Subject\", \"Hello!\")\n        msg.SetBody(\"text/plain\", \"Hello Bob and Cora!\")\n        msg.AddAlternative(\"text/html\", \"Hello \u003cb\u003eBob\u003c/b\u003e and \u003ci\u003eCora\u003c/i\u003e!\")\n        if err := msg.Attach(\"/home/Alex/lolcat.jpg\"); err != nil {\n            log.Println(err)\n            return\n        }\n\n        m := gomail.NewMailer(\"smtp.example.com\", \"user\", \"123456\", 25)\n        if err := m.Send(msg); err != nil { // This will send the email to Bob and Cora\n            log.Println(err)\n        }\n    }\n\n\n# mailer\n\n[Documentation](http://godoc.org/github.com/alexcesaro/mail/mailer)\n\nPackage mailer provides functions to easily send emails.\n\nThis package can be used as a standalone but if you want to send emails with\nnon-ASCII characters or with attachment you should use it with or inside a\npackage that helps writing emails like it is done in gomail.\n\n    package main\n\n    import (\n        \"log\"\n        \"net/mail\"\n        \"strings\"\n\n        \"github.com/alexcesaro/mail/mailer\"\n    )\n\n    func main() {\n        msg := \u0026mail.Message{\n            mail.Header{\n                \"From\":         {\"alex@example.com\"},\n                \"To\":           {\"bob@example.com\", \"cora@example.com\"},\n                \"Subject\":      {\"Hello!\"},\n                \"Content-Type\": {\"text/plain\"},\n            },\n            strings.NewReader(\"Hello, how are you ?\"),\n        }\n\n        m := mailer.NewMailer(\"smtp.example.com\", \"user\", \"123456\", 25)\n        if err := m.Send(msg); err != nil { // This will send the email to Bob and Cora\n            log.Println(err)\n        }\n    }\n\n\n# quotedprintable\n\n[Documentation](http://godoc.org/github.com/alexcesaro/mail/quotedprintable)\n\nPackage quotedprintable implements quoted-printable and message header encoding\nas specified by RFC 2045 and RFC 2047.\n\nSomeday, it might enter the Go standard library. See\n[this post](https://groups.google.com/d/topic/golang-dev/PK_ICQNJTmg/discussion)\non the golang-dev mailing-list or\n[this code review](https://codereview.appspot.com/101330049/) or\n[issue 4943](https://code.google.com/p/go/issues/detail?id=4943) of the Go bug\ntracker.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexcesaro%2Fmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexcesaro%2Fmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexcesaro%2Fmail/lists"}