Class: Mailflow::SendRawMessage
- Inherits:
-
Object
- Object
- Mailflow::SendRawMessage
- Defined in:
- lib/mailflow/send_raw_message.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Instance Method Summary collapse
- #data(data) ⇒ Object
-
#initialize(client) ⇒ SendRawMessage
constructor
A new instance of SendRawMessage.
- #mail_from(address) ⇒ Object
- #rcpt_to(*addresses) ⇒ Object
- #send! ⇒ Object
Constructor Details
#initialize(client) ⇒ SendRawMessage
Returns a new instance of SendRawMessage.
8 9 10 11 |
# File 'lib/mailflow/send_raw_message.rb', line 8 def initialize(client) @client = client @attributes = {} end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
6 7 8 |
# File 'lib/mailflow/send_raw_message.rb', line 6 def attributes @attributes end |
Instance Method Details
#data(data) ⇒ Object
27 28 29 |
# File 'lib/mailflow/send_raw_message.rb', line 27 def data(data) @attributes[:data] = Base64.encode64(data) end |
#mail_from(address) ⇒ Object
18 19 20 |
# File 'lib/mailflow/send_raw_message.rb', line 18 def mail_from(address) @attributes[:mail_from] = address end |
#rcpt_to(*addresses) ⇒ Object
22 23 24 25 |
# File 'lib/mailflow/send_raw_message.rb', line 22 def rcpt_to(*addresses) @attributes[:rcpt_to] ||= [] @attributes[:rcpt_to] += addresses end |
#send! ⇒ Object
13 14 15 16 |
# File 'lib/mailflow/send_raw_message.rb', line 13 def send! api = @client.moonrope.request(:send, :raw, @attributes) handle_api_response(api) end |