SendEmail command

The SendEmail command is used for sending out e-mails to e-mail addresses. The e-mails are originated from an API extension. You can use it to send out e-mail based receipts. For example, a customer pays through an IVR and gets an e-mail receipt. You can also use it to send out a new password for a client as a response to his IVR based request. Or if a client orders a product through IVR, he/she could get the payment details in e-mail.

Request parameters

Parameter name Example value Description Mandatory
Attachments C:\example.txt Absolute file path of one or more email attachment. Multiple attachment paths should be sparated by semicolon. no
Message Hello world Email text to send. yes
Recipient test@example.com Destination address of the e-mail. yes
Sender test@example.com Sender address of the e-mail. no
Subject Subject Subject of the e-mail to send. no
Username admin The username of the account. This parameter have to be specified to send an e-mail. yes
Password abc123 The password of the user account. This is also a mandatory parameter that you have to provide to authenticate the user account. yes

Response parameters

Parameter name Example value Description Mandatory
Code 200 Returns the status code of the response. yes
Message Command successfully executed Returns th description of the response code. yes
EmailId 6b5c6978-0cd6-4a58-86fc-3d1b279b9208 This parameter only appears if the e-mail was successfully sent. This is the Id of the e-mail. yes
NotificationName CallConnected Name of the notification request type. no

Example request and response

URL request

http://127.0.0.1:9509/api?command=SendEmail&Sender=test%40domain.com&Recipient=abc%40anotherdomain.com&Message=Hello+world&Subject=TestSubject&Username=HTTP_User_1&Password=qwe123

Response

<?xml version="1.0"?>
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Code>200</Code>
  <Message>Command successfully executed</Message>
  <EmailId>6b5c6978-0cd6-4a58-86fc-3d1b279b9208<EmailId>
</Response>

More information