OPS send_email

You could send an e-mail message with the aid of the send_email instance method.

def send_email to, message=nil, subject=nil, from=nil

Code example 1 - Definition

Method parameters

Parameter name Value Description Default value Mandatory
to string value
e.g. 'recipient@company.com'
Recipient of the e-mail message. (None) Yes
message string value
e.g. 'Hello world!'
Content of the e-mail message. Empty string No
subject string value
e.g. 'Test'
Subject of the e-mail message. Empty string No
from string value
e.g. 'sender@company.com'
Sender of the e-mail message. Empty string No

Example

ops = OPS.new '192.168.0.1', nil, '9999', 'admin', 'password'
puts ops.send_email 'recipient@company.com', 'How are you?', 'Hello', 'sender@company.com'

Code example 2 - Send an e-mail message with instance method

More information