{"id":13484006,"url":"https://github.com/benprew/pony","last_synced_at":"2025-10-07T08:30:29.779Z","repository":{"id":622344,"uuid":"261992","full_name":"benprew/pony","owner":"benprew","description":"The express way to send mail from Ruby.","archived":false,"fork":true,"pushed_at":"2024-03-28T20:11:01.000Z","size":147,"stargazers_count":1145,"open_issues_count":2,"forks_count":51,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-05-17T04:43:55.142Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"adamwiggins/pony","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benprew.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}},"created_at":"2009-07-27T22:46:36.000Z","updated_at":"2024-04-01T20:29:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/benprew/pony","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benprew%2Fpony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benprew%2Fpony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benprew%2Fpony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benprew%2Fpony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benprew","download_url":"https://codeload.github.com/benprew/pony/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235607123,"owners_count":19017298,"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-07-31T17:01:17.892Z","updated_at":"2025-10-07T08:30:24.498Z","avatar_url":"https://github.com/benprew.png","language":"Ruby","readme":"# Pony, the express way to send email in Ruby #\n\n## Overview ##\n\nRuby no longer has to be jealous of PHP's mail() function, which can send an email in a single command.\n\n    Pony.mail(:to =\u003e 'you@example.com', :from =\u003e 'me@example.com', :subject =\u003e 'hi', :body =\u003e 'Hello there.')\n    Pony.mail(:to =\u003e 'you@example.com', :html_body =\u003e '\u003ch1\u003eHello there!\u003c/h1\u003e', :body =\u003e \"In case you can't read html, Hello there.\")\n    Pony.mail(:to =\u003e 'you@example.com', :cc =\u003e 'him@example.com', :from =\u003e 'me@example.com', :subject =\u003e 'hi', :body =\u003e 'Howsit!')\n\nAny option key may be omitted except for ```:to```.  See List Of Options section for the complete list.\n\n## Transport ##\n\nPony uses ```/usr/sbin/sendmail``` to send mail if it is available, otherwise it uses SMTP to localhost.\n\nThis can be overridden if you specify a via option:\n\n    Pony.mail(:to =\u003e 'you@example.com', :via =\u003e :smtp) # sends via SMTP\n    Pony.mail(:to =\u003e 'you@example.com', :via =\u003e :sendmail) # sends via sendmail\n\nYou can also specify options for SMTP:\n\n    Pony.mail({\n      :to =\u003e 'you@example.com',\n      :via =\u003e :smtp,\n      :via_options =\u003e {\n        :address        =\u003e 'smtp.yourserver.com',\n        :port           =\u003e '25',\n        :user_name      =\u003e 'user',\n        :password       =\u003e 'password',\n        :authentication =\u003e :plain, # :plain, :login, :cram_md5, no auth by default\n        :domain         =\u003e \"localhost.localdomain\" # the HELO domain provided by the client to the server\n      }\n    })\n\nGmail example (with TLS/SSL)\n\n    Pony.mail({\n      :to =\u003e 'you@example.com',\n      :via =\u003e :smtp,\n      :via_options =\u003e {\n        :address              =\u003e 'smtp.gmail.com',\n        :port                 =\u003e '587',\n        :enable_starttls_auto =\u003e true,\n        :user_name            =\u003e 'user',\n        :password             =\u003e 'password_see_note',\n        :authentication       =\u003e :plain, # :plain, :login, :cram_md5, no auth by default\n        :domain               =\u003e \"localhost.localdomain\" # the HELO domain provided by the client to the server\n      }\n    })\n\nNote: If you use 2 step verification, you will have to generate an application specific password and NOT use your normal password - see https://support.google.com/accounts/answer/185833?hl=en\n\nAnd options for Sendmail:\n\n    Pony.mail({\n      :to =\u003e 'you@example.com',\n      :via =\u003e :sendmail,\n      :via_options =\u003e {\n        :location  =\u003e '/path/to/sendmail', # defaults to 'which sendmail' or '/usr/sbin/sendmail' if 'which' fails\n        :arguments =\u003e '-t' # -t and -i are the defaults\n      }\n    })\n\nIf you're using smtp, set ```:arguments =\u003e ''```.\n\n## Attachments ##\n\nYou can attach a file or two with the :attachments option:\n\n    Pony.mail(..., :attachments =\u003e {\"foo.zip\" =\u003e File.read(\"path/to/foo.zip\"), \"hello.txt\" =\u003e \"hello!\"})\n\nNote: An attachment's mime-type is set based on the filename (as dictated by the ruby gem mime-types).  So 'foo.pdf' has a mime-type of 'application/pdf'\n\n## Custom Headers ##\n\nPony allows you to specify custom mail headers\n\n    Pony.mail(\n      :to =\u003e 'me@example.com',\n      :headers =\u003e { \"List-ID\" =\u003e \"...\", \"X-My-Custom-Header\" =\u003e \"what a cool custom header\" }\n    )\n\nAdd additional options for headers in each part of letter (text, html)\n\n    Pony.mail(\n      :body =\u003e 'test',\n      :html_body =\u003e 'What do you know, Joe?',\n      :attachments =\u003e {\"foo.txt\" =\u003e \"content of foo.txt\"},\n      :body_part_header =\u003e { content_disposition: \"inline\" }\n    )\n\nThis will add option ```'Content-Disposition: inline'``` for text part header of letter.\n\nAlso you can add additional options for html part of latter, e.g.:\n\n    :html_body_part_header =\u003e { content_disposition: \"inline\" }\n\n\n## List Of Options ##\n\nYou can get a list of options from Pony directly:\n\n    Pony.permissable_options\n\nOptions passed pretty much directly to Mail\n\n    attachments # see Attachments section\n    bcc\n    body # the plain text body\n    body_part_header # see Custom headers section\n    cc\n    charset # In case you need to send in utf-8 or similar\n    content_type\n    from\n    headers # see Custom headers section\n    html_body # for sending html-formatted email\n    html_body_part_header # see Custom headers section\n    message_id\n    reply_to\n    sender  # Sets \"envelope from\" (and the Sender header)\n    smtp_envelope_to\n    subject\n    text_part_charset # for multipart messages, set the charset of the text part\n    to\n\nOther options\n    via # :smtp or :sendmail, see Transport section\n    via_options # specify transport options, see Transport section\n\n### Default Options ###\n\nDefault options can be set so that they don't have to be repeated. The default options you set will be overriden by any options you pass in to Pony.mail()\n\n    Pony.options = { :from =\u003e 'noreply@example.com', :via =\u003e :smtp, :via_options =\u003e { :host =\u003e 'smtp.yourserver.com' } }\n    Pony.mail(:to =\u003e 'foo@bar') # Sends mail to foo@bar from noreply@example.com using smtp\n    Pony.mail(:from =\u003e 'pony@example.com', :to =\u003e 'foo@bar') # Sends mail to foo@bar from pony@example.com using smtp\n\n\n### Override Options ###\n\nOverride options can be set so that the override value is always be used, even if a different value is passed in to Pony.options() or Pony.mail(). This can be used to configure a development or staging environment.\n\n    Pony.override_options = { :to =\u003e 'test@example.com' }\n    Pony.mail(:to =\u003e 'foo@bar') # Sends mail to test@example.com instead of foo@bar\n\n## Testing/Debugging Aids ##\n\n[![Build Status](https://travis-ci.org/benprew/pony.svg?branch=master)](https://travis-ci.org/benprew/pony)\n\n### Subject prefix ###\n\nPrepends a string to the subject line.  This is used to identify email sent from a specific environment.\n\n    Pony.subject_prefix('Prefix:')\n\n### Append options to body ###\n\nAppend the options passd into Pony.mail to the body of the email.  Useful for debugging.\n\n    Pony.append_inputs\n\n### Using Pony with Testing or Spec'ing Libraries ###\n\nAs pony relies on mail to send the mails, you can also use its TestMailer in your tests.\n\n    Pony.override_options = { :via =\u003e :test }\n    Pony.mail(:to =\u003e 'foo@bar')\n    Mail::TestMailer.deliveries.length\n    =\u003e 1\n\nFor further examples see the [corresponding section of mail's readme](https://github.com/mikel/mail#using-mail-with-testing-or-specing-libraries)\n\n## Help ##\n\nIf you need help using Pony, or it looks like you've found a bug,\nemail ponyrb@googlegroups.com.  The full forum is\nhttps://groups.google.com/forum/#!forum/ponyrb\n\n### Meta ###\n\n* Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php)\n* [Homepage](http://github.com/benprew/pony)\n* Mailing List: ponyrb@googlegroups.com\n\n## Authors ##\n*  Adam Wiggins  [@adamwiggins](https://github.com/adamwiggins)\n*  Andrea Talbot\n*  Ben Prew  [@benprew](https://github.com/benprew)\n*  Cameron Matheson  [@cmatheson](https://github.com/cmatheson)\n*  Carl Hörberg  [@carlhoerberg](https://github.com/carlhoerberg)\n*  Christian Haase  [@krissi](https://github.com/krissi)\n*  Daniel Lopes  [@danielvlopes](https://github.com/danielvlopes)\n*  Doug Hammond  [@dslh](https://github.com/dslh)\n*  Fabó Márton\n*  Hiroshi Saito  [@hiroshi](https://github.com/hiroshi)\n*  Kalin Harvey\n*  MIKAMI Yoshiyuki  [@yoshuki](https://github.com/yoshuki)\n*  Mathieu Martin  [@webmat](https://github.com/webmat)\n*  Michael Durrant  [@durrantm](https://github.com/durrantm)\n*  Michal Kwiatkowski  [@mkwiatkowski](https://github.com/mkwiatkowski)\n*  Nami-Doc\n*  Neil Middleton  [@neilmiddleton](https://github.com/neilmiddleton)\n*  Neil Mock  [@neilmock](https://github.com/neilmock)\n*  Nickolas Means  [@nmeans](https://github.com/nmeans)\n*  Othmane Benkirane  [@anaothmane](https://github.com/anaothmane)\n*  Rich Meyers  [@richmeyers](https://github.com/richmeyers)\n*  Roman Franko  [@roman-franko](https://github.com/roman-franko)\n*  Ryan Malecky  [@rmalecky](https://github.com/rmalecky)\n*  Seamus Abshere  [@seamusabshere](https://github.com/seamusabshere)\n*  Stephen Celis  [@stephencelis](https://github.com/stephencelis)\n*  Steve Root  [@steveroot](https://github.com/steveroot)\n*  arunthampi  [@arunthampi](https://github.com/arunthampi)\n*  rick  [@rick](https://github.com/rick)\n*  rohit  [@rohit](https://github.com/rohit)\n\n## Changelog ##\n\n#### 1.13.2 ####\n* Bump rake version, bump outdated gems (rspec and mini_mime)\n\n#### 1.13 ####\n* fix bug: suppress potential error message from \"which\"\n* fix bug: Add support for passing empty hashes as attachment\n\n#### 1.12 ####\n* fix bug: NoMethodError when using mail 2.7.0\n\n#### 1.11 ####\n* Improved handling of mails with both text and html bodies and attachments\n\n#### 1.10 ####\n* Add ```subject_prefix```, ```append_options``` and ```override_options```\n\n#### 1.9 ####\n* Allow options to be queried from the gem\n\n#### 1.8 ####\n* Add additional options for headers in each part of letter\n\n#### 1.7 ####\n* Better default content_type with attachments\n\n#### 1.6 ####\n* Unknown options are passed directly to mail to handle.  Remove deprecated syntax\n\n#### 1.5.1 ####\n* Loosen mail dependency to \u003e= 2.0 instead of \u003e 2.0\n\n#### 1.5 ####\n* Specify content-id of attachments as filename@hostname\n\n#### 1.4.1 ####\n* Update gemfile\n\n#### 1.4 ####\n* Updated docs\n\n#### 1.3 ####\n* Add new option ```:text_part_charset```, which allows you to specify the charset for the text portion\n\n#### 1.2 ####\n* Remove limitations on :via, and let mail handle it (this means you can say things like :via =\u003e test)\n* Add reply-to option and a bundler file\n\n#### 1.1 ####\n* Add default options\n\n#### 1.0 ####\n* Convert to using Mail as the mail-generation backend, instead of TMail\n\n#### 0.9.1 ####\n* provide the ability to set custom mail headers with something like:\n\tPony.mail(:headers =\u003e {\"List-ID\" =\u003e \"...\"})\n* provide the ability to set the Message-Id from Pony.mail\n\n#### 0.9 ####\n* merge in kalin's fixes to use tmail.destinations instead of trying to parse tmail.to, tmail.cc and tmail.bcc.  New specs to test functionality\n\n#### 0.8 ####\n* Fix bug that was allowing nil :bcc and :cc options to be passed to smtp\n\n#### 0.7 ####\n* Pass :cc and :bcc options to sendmail appropriately\n\n#### 0.6 ####\n* Add :bcc capability\n* Add :charset capability\n* Add complete list of options to readme\n* fix bug: readme examples\n\n#### 0.5 ####\n* default location of sendmail to /usr/sbin/sendmail if sendmail not in path\n* fix bug: README not showing password option (listed as pass)\n\n#### 0.4.1 ####\n* Add :cc capability\n* fix bug: resolve body not displaying when attachments sent\n\n#### 0.4 ####\n* Implemented file attachments option\n* use TLS if :tls =\u003e true\n","funding_links":[],"categories":["Email","Gems"],"sub_categories":["Mail"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenprew%2Fpony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenprew%2Fpony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenprew%2Fpony/lists"}