Skip to content

Commit

Permalink
Make several minor documentation fixes
Browse files Browse the repository at this point in the history
* Escaped SMTP in some places where it refers to the protocol, not the
  class.
* Separated `SMTP.start or SMTP#start`, so rdoc can link both methods.
* Fixed ruby example syntax, so rdoc will syntax highlight.
  • Loading branch information
nevans committed Oct 8, 2023
1 parent bf27727 commit 058ad83
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions lib/net/smtp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ class SMTPUnsupportedCommand < ProtocolError
# == What is This Library?
#
# This library provides functionality to send internet
# mail via SMTP, the Simple Mail Transfer Protocol. For details of
# SMTP itself, see [RFC5321] (http://www.ietf.org/rfc/rfc5321.txt).
# This library also implements SMTP authentication, which is often
# mail via \SMTP, the Simple Mail Transfer Protocol. For details of
# \SMTP itself, see [RFC5321] (http://www.ietf.org/rfc/rfc5321.txt).
# This library also implements \SMTP authentication, which is often
# necessary for message composers to submit messages to their
# outgoing SMTP server, see
# outgoing \SMTP server, see
# [RFC6409](http://www.ietf.org/rfc/rfc6503.txt),
# and [SMTPUTF8](http://www.ietf.org/rfc/rfc6531.txt), which is
# necessary to send messages to/from addresses containing characters
Expand Down Expand Up @@ -147,7 +147,7 @@ class SMTPUnsupportedCommand < ProtocolError
# smtp.send_message msgstr, 'from@address', 'to@address'
# smtp.finish
#
# You can also use the block form of SMTP.start/SMTP#start. This closes
# You can also use the block form of SMTP.start or SMTP#start. This closes
# the SMTP session automatically:
#
# # using block form of SMTP.start
Expand All @@ -160,30 +160,31 @@ class SMTPUnsupportedCommand < ProtocolError
# === HELO domain
#
# In almost all situations, you must provide a third argument
# to SMTP.start/SMTP#start. This is the domain name which you are on
# to SMTP.start or SMTP#start. This is the domain name which you are on
# (the host to send mail from). It is called the "HELO domain".
# The SMTP server will judge whether it should send or reject
# the SMTP session by inspecting the HELO domain.
#
# Net::SMTP.start('your.smtp.server', 25
# helo: 'mail.from.domain') { |smtp| ... }
# Net::SMTP.start('your.smtp.server', 25, helo: 'mail.from.domain') do |smtp|
# smtp.send_message msgstr, 'from@address', 'to@address'
# end
#
# === SMTP Authentication
#
# The Net::SMTP class supports three authentication schemes;
# PLAIN, LOGIN and CRAM MD5. (SMTP Authentication: [RFC2554])
# To use SMTP authentication, pass extra arguments to
# SMTP.start/SMTP#start.
# SMTP.start or SMTP#start.
#
# # PLAIN
# Net::SMTP.start('your.smtp.server', 25
# Net::SMTP.start('your.smtp.server', 25,
# user: 'Your Account', secret: 'Your Password', authtype: :plain)
# # LOGIN
# Net::SMTP.start('your.smtp.server', 25
# Net::SMTP.start('your.smtp.server', 25,
# user: 'Your Account', secret: 'Your Password', authtype: :login)
#
# # CRAM MD5
# Net::SMTP.start('your.smtp.server', 25
# Net::SMTP.start('your.smtp.server', 25,
# user: 'Your Account', secret: 'Your Password', authtype: :cram_md5)
#
class SMTP < Protocol
Expand Down

0 comments on commit 058ad83

Please sign in to comment.