Send an e-mail
sendEMail sends an e-mail through the mail server set in System Management → System Parameters → Billing, SMTP Server, the same server the switch uses for invoices and notifications. Use it to send reports or alerts from your scripts without a mail server of your own.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
from |
string | yes | Sender address |
to |
string | yes | Recipients, comma-separated |
cc |
string | yes | Copy recipients, comma-separated. Pass an empty string for none |
bcc |
string | yes | Blind copy recipients, comma-separated. Pass an empty string for none |
subject |
string | yes | Subject |
body |
string | yes | Text of the message |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK when the message was sent |
Example
Section titled “Example”call("sendEMail", { "from": "noc@example.com", "to": "ops@example.com,billing@example.com", "cc": "", "bcc": "", "subject": "Daily traffic report", "body": "Calls: 18,240\nMinutes: 61,905\n",}){"result": "OK"}Related
Section titled “Related”- Settings: the SMTP server
- Low balance notifications