start(address, port = nil, helo = 'localhost.localdomain', user = nil, secret = nil, authtype = nil)public
This method is equivalent to:
Net::SMTP.start('your.smtp.server') do |smtp| smtp.send_message msgstr, 'firstname.lastname@example.org', ['email@example.com'] end
If called with a block, the newly-opened Net::SMTP object is yielded to the block, and automatically closed when the block finishes. If called without a block, the newly-opened Net::SMTP object is returned to the caller, and it is the caller’s responsibility to close it when finished.
address is the hostname or ip address of your smtp server.
port is the port to connect to; it defaults to port 25.
helo is the HELO domain provided by the client to the server (see overview comments); it defaults to ‘localhost.localdomain’.
The remaining arguments are used for SMTP authentication, if required or desired. user is the account name; secret is your password or other authentication token; and authtype is the authentication type, one of :plain, :login, or :cram_md5. See the discussion of SMTP Authentication in the overview notes.
This method may raise:
# File lib/net/smtp.rb, line 312 def SMTP.start(address, port = nil, helo = 'localhost.localdomain', user = nil, secret = nil, authtype = nil, &block) # :yield: smtp new(address, port).start(helo, user, secret, authtype, &block) end