Class: Rex::Proto::Mms::Model::Message
- Inherits:
-
Object
- Object
- Rex::Proto::Mms::Model::Message
- Defined in:
- lib/rex/proto/mms/model/message.rb
Instance Attribute Summary collapse
-
#attachment ⇒ String
The loaded attachment converted to Base64.
-
#attachment_name ⇒ String
The attachment base name extracted from :attachment.
-
#content_type ⇒ Fixnum
The content type of the attachment.
-
#from ⇒ String
The from field in the email.
-
#message ⇒ String
The text message.
-
#subject ⇒ String
The subject of the email.
-
#to ⇒ String
The to field in the email.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Rex::Proto::Mms::Model::Message
constructor
Initializes the SMTP object.
-
#to_s ⇒ String
Returns the raw MMS message.
Constructor Details
#initialize(opts = {}) ⇒ Rex::Proto::Mms::Model::Message
Initializes the SMTP object.
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/rex/proto/mms/model/message.rb', line 48 def initialize(opts={}) self.from = opts[:from] self.to = opts[:to] self. = opts[:message] self.subject = opts[:subject] self.content_type = opts[:content_type] if opts[:attachment_path] self. = load_file_to_base64(opts[:attachment_path]) self. = File.basename(opts[:attachment_path]) end end |
Instance Attribute Details
#attachment ⇒ String
Returns The loaded attachment converted to Base64.
19 20 21 |
# File 'lib/rex/proto/mms/model/message.rb', line 19 def @attachment end |
#attachment_name ⇒ String
Returns The attachment base name extracted from :attachment.
35 36 37 |
# File 'lib/rex/proto/mms/model/message.rb', line 35 def @attachment_name end |
#content_type ⇒ Fixnum
Returns The content type of the attachment.
15 16 17 |
# File 'lib/rex/proto/mms/model/message.rb', line 15 def content_type @content_type end |
#from ⇒ String
Returns The from field in the email.
23 24 25 |
# File 'lib/rex/proto/mms/model/message.rb', line 23 def from @from end |
#message ⇒ String
Returns The text message.
11 12 13 |
# File 'lib/rex/proto/mms/model/message.rb', line 11 def @message end |
#subject ⇒ String
Returns The subject of the email.
31 32 33 |
# File 'lib/rex/proto/mms/model/message.rb', line 31 def subject @subject end |
#to ⇒ String
Returns The to field in the email.
27 28 29 |
# File 'lib/rex/proto/mms/model/message.rb', line 27 def to @to end |
Instance Method Details
#to_s ⇒ String
Returns the raw MMS message
64 65 66 |
# File 'lib/rex/proto/mms/model/message.rb', line 64 def to_s end |