-
Notifications
You must be signed in to change notification settings - Fork 939
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1510 from mikel/chore/remove-trailing-whitespace
[Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
- Loading branch information
Showing
38 changed files
with
307 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,45 +3,45 @@ | |
module Mail | ||
|
||
# Allows you to create a new Mail::Message object. | ||
# | ||
# | ||
# You can make an email via passing a string or passing a block. | ||
# | ||
# | ||
# For example, the following two examples will create the same email | ||
# message: | ||
# | ||
# | ||
# Creating via a string: | ||
# | ||
# | ||
# string = "To: [email protected]\r\n" | ||
# string << "From: [email protected]\r\n" | ||
# string << "Subject: This is an email\r\n" | ||
# string << "\r\n" | ||
# string << "This is the body" | ||
# Mail.new(string) | ||
# | ||
# | ||
# Or creating via a block: | ||
# | ||
# | ||
# message = Mail.new do | ||
# to '[email protected]' | ||
# from '[email protected]' | ||
# subject 'This is an email' | ||
# body 'This is the body' | ||
# end | ||
# | ||
# | ||
# Or creating via a hash (or hash like object): | ||
# | ||
# | ||
# message = Mail.new({:to => '[email protected]', | ||
# 'from' => '[email protected]', | ||
# :subject => 'This is an email', | ||
# :body => 'This is the body' }) | ||
# | ||
# | ||
# Note, the hash keys can be strings or symbols, the passed in object | ||
# does not need to be a hash, it just needs to respond to :each_pair | ||
# and yield each key value pair. | ||
# | ||
# | ||
# As a side note, you can also create a new email through creating | ||
# a Mail::Message object directly and then passing in values via string, | ||
# symbol or direct method calls. See Mail::Message for more information. | ||
# | ||
# | ||
# mail = Mail.new | ||
# mail.to = '[email protected]' | ||
# mail[:from] = '[email protected]' | ||
|
@@ -54,20 +54,20 @@ def self.new(*args, &block) | |
# Sets the default delivery method and retriever method for all new Mail objects. | ||
# The delivery_method and retriever_method default to :smtp and :pop3, with defaults | ||
# set. | ||
# | ||
# | ||
# So sending a new email, if you have an SMTP server running on localhost is | ||
# as easy as: | ||
# | ||
# | ||
# Mail.deliver do | ||
# to '[email protected]' | ||
# from '[email protected]' | ||
# subject 'hi there!' | ||
# body 'this is a body' | ||
# end | ||
# | ||
# | ||
# If you do not specify anything, you will get the following equivalent code set in | ||
# every new mail object: | ||
# | ||
# | ||
# Mail.defaults do | ||
# delivery_method :smtp, { :address => "localhost", | ||
# :port => 25, | ||
|
@@ -76,24 +76,24 @@ def self.new(*args, &block) | |
# :password => nil, | ||
# :authentication => nil, | ||
# :enable_starttls_auto => true } | ||
# | ||
# | ||
# retriever_method :pop3, { :address => "localhost", | ||
# :port => 995, | ||
# :user_name => nil, | ||
# :password => nil, | ||
# :enable_ssl => true } | ||
# end | ||
# | ||
# | ||
# Mail.delivery_method.new #=> Mail::SMTP instance | ||
# Mail.retriever_method.new #=> Mail::POP3 instance | ||
# | ||
# Each mail object inherits the default set in Mail.delivery_method, however, on | ||
# a per email basis, you can override the method: | ||
# | ||
# mail.delivery_method :smtp | ||
# | ||
# | ||
# Or you can override the method and pass in settings: | ||
# | ||
# | ||
# mail.delivery_method :smtp, :address => 'some.host' | ||
def self.defaults(&block) | ||
Configuration.instance.instance_eval(&block) | ||
|
@@ -112,21 +112,21 @@ def self.retriever_method | |
# Send an email using the default configuration. You do need to set a default | ||
# configuration first before you use self.deliver, if you don't, an appropriate | ||
# error will be raised telling you to. | ||
# | ||
# | ||
# If you do not specify a delivery type, SMTP will be used. | ||
# | ||
# | ||
# Mail.deliver do | ||
# to '[email protected]' | ||
# from '[email protected]' | ||
# subject 'This is a test email' | ||
# body 'Not much to say here' | ||
# end | ||
# | ||
# | ||
# You can also do: | ||
# | ||
# | ||
# mail = Mail.read('email.eml') | ||
# mail.deliver! | ||
# | ||
# | ||
# And your email object will be created and sent. | ||
def self.deliver(*args, &block) | ||
mail = self.new(args, &block) | ||
|
@@ -190,7 +190,7 @@ def Mail.connection(&block) | |
|
||
# You can register an object to be informed of every email that is sent through | ||
# this method. | ||
# | ||
# | ||
# Your object needs to respond to a single method #delivered_email(mail) | ||
# which receives the email that is sent. | ||
def self.register_observer(observer) | ||
|
@@ -208,7 +208,7 @@ def self.unregister_observer(observer) | |
# You can register an object to be given every mail object that will be sent, | ||
# before it is sent. So if you want to add special headers or modify any | ||
# email that gets sent through the Mail library, you can do so. | ||
# | ||
# | ||
# Your object needs to respond to a single method #delivering_email(mail) | ||
# which receives the email that is about to be sent. Make your modifications | ||
# directly to this object. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,18 +3,18 @@ | |
|
||
module Mail | ||
# == Sending Email with SMTP | ||
# | ||
# | ||
# Mail allows you to send emails using SMTP. This is done by wrapping Net::SMTP in | ||
# an easy to use manner. | ||
# | ||
# | ||
# === Sending via SMTP server on Localhost | ||
# | ||
# | ||
# Sending locally (to a postfix or sendmail server running on localhost) requires | ||
# no special setup. Just to Mail.deliver &block or message.deliver! and it will | ||
# be sent in this method. | ||
# | ||
# | ||
# === Sending via MobileMe | ||
# | ||
# | ||
# Mail.defaults do | ||
# delivery_method :smtp, { :address => "smtp.me.com", | ||
# :port => 587, | ||
|
@@ -24,9 +24,9 @@ module Mail | |
# :authentication => 'plain', | ||
# :enable_starttls_auto => true } | ||
# end | ||
# | ||
# | ||
# === Sending via GMail | ||
# | ||
# | ||
# Mail.defaults do | ||
# delivery_method :smtp, { :address => "smtp.gmail.com", | ||
# :port => 587, | ||
|
@@ -48,30 +48,30 @@ module Mail | |
# verify mode constant (OpenSSL::SSL::VERIFY_NONE, OpenSSL::SSL::VERIFY_PEER), | ||
# or a string containing the name of an OpenSSL verify mode (none, peer). | ||
# | ||
# === Others | ||
# | ||
# === Others | ||
# | ||
# Feel free to send me other examples that were tricky | ||
# | ||
# | ||
# === Delivering the email | ||
# | ||
# | ||
# Once you have the settings right, sending the email is done by: | ||
# | ||
# | ||
# Mail.deliver do | ||
# to '[email protected]' | ||
# from '[email protected]' | ||
# subject 'testing sendmail' | ||
# body 'testing sendmail' | ||
# end | ||
# | ||
# | ||
# Or by calling deliver on a Mail message | ||
# | ||
# | ||
# mail = Mail.new do | ||
# to '[email protected]' | ||
# from '[email protected]' | ||
# subject 'testing sendmail' | ||
# body 'testing sendmail' | ||
# end | ||
# | ||
# | ||
# mail.deliver! | ||
class SMTP | ||
attr_accessor :settings | ||
|
Oops, something went wrong.