{"id":15032681,"url":"https://github.com/ruby/net-smtp","last_synced_at":"2025-05-15T05:00:17.190Z","repository":{"id":35943248,"uuid":"200769626","full_name":"ruby/net-smtp","owner":"ruby","description":"This library provides functionality to send internet mail via SMTP, the Simple Mail Transfer Protocol.","archived":false,"fork":false,"pushed_at":"2025-02-07T01:16:32.000Z","size":315,"stargazers_count":50,"open_issues_count":14,"forks_count":32,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-05-06T10:13:44.120Z","etag":null,"topics":["hacktoberfest","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruby.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"COPYING","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":"2019-08-06T03:29:18.000Z","updated_at":"2025-04-04T04:39:02.000Z","dependencies_parsed_at":"2024-01-04T11:28:00.261Z","dependency_job_id":"ba122c81-4264-4609-a34c-baa51813065d","html_url":"https://github.com/ruby/net-smtp","commit_stats":{"total_commits":247,"total_committers":43,"mean_commits":5.744186046511628,"dds":0.7408906882591093,"last_synced_commit":"53482b817f7c0be2d9bce4eae088c019f7ee0ac3"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fnet-smtp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fnet-smtp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fnet-smtp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fnet-smtp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruby","download_url":"https://codeload.github.com/ruby/net-smtp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253411522,"owners_count":21904147,"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":["hacktoberfest","ruby"],"created_at":"2024-09-24T20:19:07.375Z","updated_at":"2025-05-15T05:00:17.130Z","avatar_url":"https://github.com/ruby.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Net::SMTP\n\nThis library provides functionality to send internet mail via SMTP, the Simple Mail Transfer Protocol.\n\nFor details of SMTP itself, see [RFC2821](http://www.ietf.org/rfc/rfc2821.txt).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'net-smtp'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install net-smtp\n\n## Usage\n\n### Sending Messages\n\nYou must open a connection to an SMTP server before sending messages.\nThe first argument is the address of your SMTP server, and the second\nargument is the port number. Using SMTP.start with a block is the simplest\nway to do this. This way, the SMTP connection is closed automatically\nafter the block is executed.\n\n```ruby\nrequire 'net/smtp'\nNet::SMTP.start('your.smtp.server', 25) do |smtp|\n  # Use the SMTP object smtp only in this block.\nend\n```\n\nReplace 'your.smtp.server' with your SMTP server. Normally\nyour system manager or internet provider supplies a server\nfor you.\n\nThen you can send messages.\n\n```ruby\nmsgstr = \u003c\u003cEND_OF_MESSAGE\nFrom: Your Name \u003cyour@mail.address\u003e\nTo: Destination Address \u003csomeone@example.com\u003e\nSubject: test message\nDate: Sat, 23 Jun 2001 16:26:43 +0900\nMessage-Id: \u003cunique.message.id.string@example.com\u003e\n\nThis is a test message.\nEND_OF_MESSAGE\n\nrequire 'net/smtp'\nNet::SMTP.start('your.smtp.server', 25) do |smtp|\n  smtp.send_message msgstr,\n                    'your@mail.address',\n                    'his_address@example.com'\nend\n```\n\n### Closing the Session\n\nYou MUST close the SMTP session after sending messages, by calling\nthe #finish method:\n\n```ruby\n# using SMTP#finish\nsmtp = Net::SMTP.start('your.smtp.server', 25)\nsmtp.send_message msgstr, 'from@address', 'to@address'\nsmtp.finish\n```\n\nYou can also use the block form of SMTP.start/SMTP#start.  This closes\nthe SMTP session automatically:\n\n```ruby\n# using block form of SMTP.start\nNet::SMTP.start('your.smtp.server', 25) do |smtp|\n  smtp.send_message msgstr, 'from@address', 'to@address'\nend\n```\n\nI strongly recommend this scheme.  This form is simpler and more robust.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/ruby/net-smtp.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fnet-smtp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruby%2Fnet-smtp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fnet-smtp/lists"}