https://github.com/ruby/net-smtp
This library provides functionality to send internet mail via SMTP, the Simple Mail Transfer Protocol.
https://github.com/ruby/net-smtp
Keywords
hacktoberfest ruby
Keywords from Contributors
webrick rubygems bigdecimal repl debugger debugging-tool strscan lalr-parser-generator parser-generator documentation-tool
Last synced: about 10 hours ago
JSON representation
Repository metadata
This library provides functionality to send internet mail via SMTP, the Simple Mail Transfer Protocol.
- Host: GitHub
- URL: https://github.com/ruby/net-smtp
- Owner: ruby
- License: other
- Created: 2019-08-06T03:29:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-11-25T02:15:57.000Z (3 months ago)
- Last Synced: 2026-02-14T18:41:48.222Z (17 days ago)
- Topics: hacktoberfest, ruby
- Language: Ruby
- Homepage:
- Size: 312 KB
- Stars: 55
- Watchers: 34
- Forks: 35
- Open Issues: 16
- Releases: 14
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- License: COPYING
README.md
Net::SMTP
This library provides functionality to send internet mail via SMTP, the Simple Mail Transfer Protocol.
For details of SMTP itself, see RFC2821.
Installation
Add this line to your application's Gemfile:
gem 'net-smtp'
And then execute:
$ bundle
Or install it yourself as:
$ gem install net-smtp
Usage
Sending Messages
You must open a connection to an SMTP server before sending messages.
The first argument is the address of your SMTP server, and the second
argument is the port number. Using SMTP.start with a block is the simplest
way to do this. This way, the SMTP connection is closed automatically
after the block is executed.
require 'net/smtp'
Net::SMTP.start('your.smtp.server', 25) do |smtp|
# Use the SMTP object smtp only in this block.
end
Replace 'your.smtp.server' with your SMTP server. Normally
your system manager or internet provider supplies a server
for you.
Then you can send messages.
msgstr = <<END_OF_MESSAGE
From: Your Name <your@mail.address>
To: Destination Address <someone@example.com>
Subject: test message
Date: Sat, 23 Jun 2001 16:26:43 +0900
Message-Id: <unique.message.id.string@example.com>
This is a test message.
END_OF_MESSAGE
require 'net/smtp'
Net::SMTP.start('your.smtp.server', 25) do |smtp|
smtp.send_message msgstr,
'your@mail.address',
'his_address@example.com'
end
Closing the Session
You MUST close the SMTP session after sending messages, by calling
the #finish method:
# using SMTP#finish
smtp = Net::SMTP.start('your.smtp.server', 25)
smtp.send_message msgstr, 'from@address', 'to@address'
smtp.finish
You can also use the block form of SMTP.start/SMTP#start. This closes
the SMTP session automatically:
# using block form of SMTP.start
Net::SMTP.start('your.smtp.server', 25) do |smtp|
smtp.send_message msgstr, 'from@address', 'to@address'
end
I strongly recommend this scheme. This form is simpler and more robust.
Development
After 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.
To 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.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/net-smtp.
Owner metadata
- Name: The Ruby Programming Language
- Login: ruby
- Email: info@ruby-lang.org
- Kind: organization
- Description: Repositories related to the Ruby Programming language
- Website: https://www.ruby-lang.org/
- Location: Matsue, Japan
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/210414?v=4
- Repositories: 171
- Last ynced at: 2023-04-09T03:40:20.875Z
- Profile URL: https://github.com/ruby
GitHub Events
Total
- Release event: 1
- Delete event: 2
- Pull request event: 12
- Fork event: 4
- Issues event: 5
- Watch event: 4
- Issue comment event: 10
- Push event: 10
- Pull request review event: 1
- Create event: 5
Last Year
- Pull request event: 5
- Fork event: 2
- Issues event: 2
- Watch event: 1
- Issue comment event: 1
- Create event: 1
Committers metadata
Last synced: 2 days ago
Total Commits: 252
Total Committers: 43
Avg Commits per committer: 5.86
Development Distribution Score (DDS): 0.746
Commits in past year: 2
Committers in past year: 1
Avg Commits per committer in past year: 2.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| aamine | a****e@b****e | 64 |
| TOMITA Masahiro | t****y@t****g | 41 |
| Hiroshi SHIBATA | h****t@r****g | 34 |
| nobu | n****u@b****e | 14 |
| matz | m****z@b****e | 12 |
| kazu | k****u@b****e | 8 |
| shugo | s****o@b****e | 7 |
| tenderlove | t****e@b****e | 6 |
| nick evans | n****s@g****m | 6 |
| drbrain | d****n@b****e | 5 |
| dependabot[bot] | 4****] | 4 |
| gsinclair | g****r@b****e | 3 |
| Arnt Gulbrandsen | a****t@g****o | 3 |
| Jeremy Evans | c****e@j****t | 3 |
| Olle Jonsson | o****n@g****m | 3 |
| Kazuki Yamaguchi | k@r****p | 3 |
| Yusuke Endoh | m****e@r****g | 3 |
| zzak | z****k@b****e | 2 |
| normal | n****l@b****e | 2 |
| glass | g****s@b****e | 2 |
| Takashi Kokubun | t****n@g****m | 2 |
| Tom Freudenberg | t****g@4****e | 2 |
| Yuta Saito | k****n@g****m | 2 |
| ko1 | k****1@b****e | 2 |
| shyouhei | s****i@b****e | 1 |
| ojab | o****b@o****u | 1 |
| naruse | n****e@b****e | 1 |
| mohamed | m****z@g****m | 1 |
| marcandre | m****e@b****e | 1 |
| m-nakamura145 | m****5@g****m | 1 |
| and 13 more... | ||
Committer domains:
- ruby-lang.org: 2
- idev.lt: 1
- sorah.jp: 1
- ojab.ru: 1
- 4commerce.de: 1
- rhe.jp: 1
- jeremyevans.net: 1
- gulbrandsen.priv.no: 1
- tmtm.org: 1
Issue and Pull Request metadata
Last synced: 19 days ago
Total issues: 12
Total pull requests: 94
Average time to close issues: 5 months
Average time to close pull requests: 28 days
Total issue authors: 11
Total pull request authors: 27
Average comments per issue: 1.33
Average comments per pull request: 0.65
Merged pull request: 71
Bot issues: 0
Bot pull requests: 4
Past year issues: 1
Past year pull requests: 3
Past year average time to close issues: N/A
Past year average time to close pull requests: about 21 hours
Past year issue authors: 1
Past year pull request authors: 2
Past year average comments per issue: 0.0
Past year average comments per pull request: 1.0
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 2
Top Issue Authors
- Neustradamus (2)
- JensDebergh (1)
- Lex1027 (1)
- RalphAtHamburg (1)
- hengwoon (1)
- yahonda (1)
- mohamedhafez (1)
- papeng (1)
- jrafanie (1)
- ojab (1)
- aaronjensen (1)
Top Pull Request Authors
- tmtm (30)
- nevans (13)
- hsbt (12)
- kateinoigakukun (4)
- dependabot[bot] (4)
- olleolleolle (3)
- sorah (2)
- m-nakamura145 (2)
- casperisfine (2)
- mantas (2)
- tas50 (2)
- bquorning (2)
- mohamedhafez (2)
- znz (1)
- TomFreudenberg (1)
Top Issue Labels
Top Pull Request Labels
- dependencies (4)
- github_actions (2)
Package metadata
- Total packages: 21
-
Total downloads:
- rubygems: 541,820,958 total
- Total docker downloads: 7,257,417,380
- Total dependent packages: 73 (may contain duplicates)
- Total dependent repositories: 35,043 (may contain duplicates)
- Total versions: 80
- Total maintainers: 4
gem.coop: net-smtp
Simple Mail Transfer Protocol client library for Ruby.
- Homepage: https://github.com/ruby/net-smtp
- Documentation: http://www.rubydoc.info/gems/net-smtp/
- Licenses: Ruby,BSD-2-Clause
- Latest release: 0.5.1 (published about 1 year ago)
- Last Synced: 2026-03-01T11:03:20.017Z (3 days ago)
- Versions: 14
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 270,962,707 Total
- Docker Downloads: 3,628,708,690
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Docker downloads count: 0.021%
- Average: 0.031%
- Downloads: 0.104%
- Maintainers (3)
rubygems.org: net-smtp
Simple Mail Transfer Protocol client library for Ruby.
- Homepage: https://github.com/ruby/net-smtp
- Documentation: http://www.rubydoc.info/gems/net-smtp/
- Licenses: Ruby,BSD-2-Clause
- Latest release: 0.5.1 (published about 1 year ago)
- Last Synced: 2026-02-28T12:03:28.379Z (3 days ago)
- Versions: 14
- Dependent Packages: 73
- Dependent Repositories: 35,043
- Downloads: 270,858,251 Total
- Docker Downloads: 3,628,708,690
-
Rankings:
- Docker downloads count: 0.025%
- Dependent repos count: 0.177%
- Downloads: 0.232%
- Dependent packages count: 0.42%
- Average: 2.543%
- Forks count: 5.279%
- Stargazers count: 9.124%
- Maintainers (3)
proxy.golang.org: github.com/ruby/net-smtp
- Homepage:
- Documentation: https://pkg.go.dev/github.com/ruby/net-smtp#section-documentation
- Licenses: other
- Latest release: v0.5.1 (published about 1 year ago)
- Last Synced: 2026-03-01T11:27:18.310Z (2 days ago)
- Versions: 12
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Forks count: 4.536%
- Stargazers count: 6.801%
- Average: 7.928%
- Dependent packages count: 9.576%
- Dependent repos count: 10.802%
alpine-v3.18: ruby-net-smtp
Simple Mail Transfer Protocol client library for Ruby
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.3.4-r0 (published almost 2 years ago)
- Last Synced: 2026-02-03T04:47:46.067Z (29 days ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 11.16%
- Forks count: 20.458%
- Stargazers count: 24.183%
- Maintainers (1)
alpine-v3.18: ruby-net-smtp-doc
Simple Mail Transfer Protocol client library for Ruby (ri docs)
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.3.4-r0 (published almost 2 years ago)
- Last Synced: 2026-02-03T04:48:17.101Z (29 days ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 11.16%
- Forks count: 20.458%
- Stargazers count: 24.183%
- Maintainers (1)
alpine-v3.16: ruby-net-smtp-doc
Simple Mail Transfer Protocol client library for Ruby (ri docs)
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.3.4-r0 (published almost 2 years ago)
- Last Synced: 2026-02-03T04:47:35.565Z (29 days ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Average: 15.314%
- Forks count: 15.689%
- Stargazers count: 18.254%
- Dependent packages count: 27.311%
- Maintainers (1)
alpine-v3.16: ruby-net-smtp
Simple Mail Transfer Protocol client library for Ruby
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.3.4-r0 (published almost 2 years ago)
- Last Synced: 2026-02-03T04:47:53.376Z (29 days ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Average: 15.314%
- Forks count: 15.689%
- Stargazers count: 18.254%
- Dependent packages count: 27.311%
- Maintainers (1)
alpine-edge: ruby-net-smtp
Simple Mail Transfer Protocol client library for Ruby
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.5.1-r0 (published 11 months ago)
- Last Synced: 2026-02-23T08:01:34.957Z (9 days ago)
- Versions: 6
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 14.641%
- Average: 15.489%
- Forks count: 21.619%
- Stargazers count: 25.697%
- Maintainers (1)
alpine-edge: ruby-net-smtp-doc
Simple Mail Transfer Protocol client library for Ruby (ri docs)
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.5.1-r0 (published 11 months ago)
- Last Synced: 2026-02-23T08:01:33.294Z (9 days ago)
- Versions: 6
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 14.641%
- Average: 15.489%
- Forks count: 21.619%
- Stargazers count: 25.697%
- Maintainers (1)
alpine-v3.17: ruby-net-smtp
Simple Mail Transfer Protocol client library for Ruby
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.3.4-r0 (published almost 2 years ago)
- Last Synced: 2026-03-02T09:14:05.512Z (1 day ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Average: 16.931%
- Forks count: 18.693%
- Stargazers count: 21.775%
- Dependent packages count: 27.254%
- Maintainers (1)
alpine-v3.17: ruby-net-smtp-doc
Simple Mail Transfer Protocol client library for Ruby (ri docs)
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.3.4-r0 (published almost 2 years ago)
- Last Synced: 2026-03-02T09:14:06.103Z (1 day ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Average: 16.931%
- Forks count: 18.693%
- Stargazers count: 21.775%
- Dependent packages count: 27.254%
- Maintainers (1)
alpine-v3.22: ruby-net-smtp-doc
Simple Mail Transfer Protocol client library for Ruby (ri docs)
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.5.1-r0 (published 11 months ago)
- Last Synced: 2026-02-03T04:47:52.600Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.21: ruby-net-smtp-doc
Simple Mail Transfer Protocol client library for Ruby (ri docs)
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.5.1-r0 (published 10 months ago)
- Last Synced: 2026-02-03T04:47:54.298Z (29 days ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.22: ruby-net-smtp
Simple Mail Transfer Protocol client library for Ruby
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.5.1-r0 (published 11 months ago)
- Last Synced: 2026-02-03T04:48:23.508Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.20: ruby-net-smtp-doc
Simple Mail Transfer Protocol client library for Ruby (ri docs)
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.5.1-r0 (published 10 months ago)
- Last Synced: 2026-02-03T04:47:57.804Z (29 days ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.21: ruby-net-smtp
Simple Mail Transfer Protocol client library for Ruby
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.5.1-r0 (published 10 months ago)
- Last Synced: 2026-02-03T04:48:07.648Z (29 days ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.20: ruby-net-smtp
Simple Mail Transfer Protocol client library for Ruby
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.5.1-r0 (published 10 months ago)
- Last Synced: 2026-02-03T04:48:18.949Z (29 days ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.19: ruby-net-smtp
Simple Mail Transfer Protocol client library for Ruby
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.3.4-r0 (published almost 2 years ago)
- Last Synced: 2026-02-03T04:47:47.613Z (29 days ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.19: ruby-net-smtp-doc
Simple Mail Transfer Protocol client library for Ruby (ri docs)
- Homepage: https://github.com/ruby/net-smtp
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.3.4-r0 (published almost 2 years ago)
- Last Synced: 2026-02-03T04:48:41.573Z (29 days ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.23: ruby-net-smtp-doc
Simple Mail Transfer Protocol client library for Ruby (ri docs)
alpine-v3.23: ruby-net-smtp
Simple Mail Transfer Protocol client library for Ruby
Dependencies
- bundler >= 0 development
- rake >= 0 development
- test-unit >= 0 development
- net-protocol >= 0
- actions/checkout v3 composite
- ruby/setup-ruby v1 composite
Score: 30.80117711884756