Sends an SMS/MMS message.

@param to the number to send the message to.
@param from the number that the message is from.
@param body the body text of the message.
421948
public void sendMessage(
      @Nonnull final String to,
      @Nonnull final String from,
      @Nonnull final String body) {
    proxy.sendMessage(to, from, body);
  }
1286309
def send(self, header, body):
        
        message = MsgProto(EMsg.ClientToGC)
        message.header.routing_appid = self.app_id
        message.body.appid = self.app_id
        message.body.msgtype = (set_proto_bit(header.msg)
                                if header.proto
                                else header.msg
                                )
        message.body.payload = header.serialize() + body
        self.steam.send(message)
1082858
def send_sms(body, from_phone, to, flash=False, fail_silently=False,
             auth_user=None, auth_password=None, connection=None):
    
    from sendsms.message import SmsMessage
    connection = connection or get_connection(
        username = auth_user,
        password = auth_password,
        fail_silently = fail_silently
    )
    return SmsMessage(body=body, from_phone=from_phone, to=to, \
        flash=flash, connection=connection).send()
696625
def send(self, messages):
        """"""

        tmpSms = SMS(to='', message='')
        if str(type(messages)) == str(type(tmpSms)):
            messages = [messages]

        xml_root = self.__init_xml('Message')
        wrapper_id = 0

        for m in messages:
            m.wrapper_id = wrapper_id
            msg = self.__build_sms_data(m)
            sms = etree.SubElement(xml_root, 'SMS')
            for sms_element in msg:
                element = etree.SubElement(sms, sms_element)
                element.text = msg[sms_element]

        # print etree.tostring(xml_root)
        response = clockwork_http.request(SMS_URL, etree.tostring(xml_root, encoding='utf-8'))
        response_data = response['data']

        # print response_data
        data_etree = etree.fromstring(response_data)

        # Check for general error
        err_desc = data_etree.find('ErrDesc')
        if err_desc is not None:
            raise clockwork_exceptions.ApiException(err_desc.text, data_etree.find('ErrNo').text)

        # Return a consistent object
        results = []
        for sms in data_etree:
            matching_sms = next((s for s in messages if str(s.wrapper_id) == sms.find('WrapperID').text), None)
            new_result = SMSResponse(
                sms = matching_sms,
                id = '' if sms.find('MessageID') is None else sms.find('MessageID').text,
                error_code = 0 if sms.find('ErrNo') is None else sms.find('ErrNo').text,
                error_message = '' if sms.find('ErrDesc') is None else sms.find('ErrDesc').text,
                success = True if sms.find('ErrNo') is None else (sms.find('ErrNo').text == 0)
            )
            results.append(new_result)

        if len(results) > 1:
            return results

        return results[0]
521651
@Deprecated
    @JsonProperty("from")
    public void setFrom(String from) throws IllegalArgumentException {
        if (messagingServiceSID != null) {
            throw new IllegalArgumentException("You must specify either `from` or `messagingServiceSID`, but not both");
        }
        this.from = from;
    }
17260
public static void sendMail(String to, String title, String content, String from, String key) throws Exception {
        setFrom(from);
        setKey(key);
        sendMail(to, title, content);
    }
911850
protected function sendMessageTo($source, $from, $to, $subject, $body) {
		if($to instanceof Member) $to = $to->Email;
		$this->sendViaEmail($source, $from, $to, $subject, $body);
	}
1005814
def send(sms_to, sms_body, **kwargs):
    
    headers = {
        "User-Agent": "DBMail/%s" % get_version(),
    }

    kwargs.update({
        'user': settings.SMSAERO_LOGIN,
        'password': settings.SMSAERO_MD5_PASSWORD,
        'from': kwargs.pop('sms_from', settings.SMSAERO_FROM),
        'to': sms_to.replace('+', ''),
        'text': from_unicode(sms_body),
        'answer': 'json',
    })

    http = HTTPConnection(kwargs.pop("api_url", "gate.smsaero.ru"))
    http.request("GET", "/send/?" + urlencode(kwargs), headers=headers)
    response = http.getresponse()

    if response.status != 200:
        raise AeroSmsError(response.reason)

    read = response.read().decode(response.headers.get_content_charset())
    data = json.loads(read)

    status = None
    if 'result' in data:
        status = data['result']

    sms_id = None
    if 'id' in data:
        sms_id = data['id']

    if sms_id and status == 'accepted':
        return True
    return False
221906
func (c *SMS) Send(msg *SMSMessage) (*MessageResponse, error) {
	if len(msg.From) <= 0 {
		return nil, errors.New("Invalid From field specified")
	}

	if len(msg.To) <= 0 {
		return nil, errors.New("Invalid To field specified")
	}

	if len(msg.ClientReference) > 40 {
		return nil, errors.New("Client reference too long")
	}

	var messageResponse *MessageResponse

	switch msg.Type {
	case Text:
	case Unicode:
		if len(msg.Text) <= 0 {
			return nil, errors.New("Invalid message text")
		}
	case Binary:
		if len(msg.UDH) == 0 || len(msg.Body) == 0 {
			return nil, errors.New("Invalid binary message")
		}

	case WAPPush:
		if len(msg.URL) == 0 || len(msg.Title) == 0 {
			return nil, errors.New("Invalid WAP Push parameters")
		}
	}
	if !c.client.useOauth {
		msg.apiKey = c.client.apiKey
		msg.apiSecret = c.client.apiSecret
	}

	var r *http.Request
	buf, err := json.Marshal(msg)
	if err != nil {
		return nil, errors.New("invalid message struct - unable to convert to JSON")
	}
	b := bytes.NewBuffer(buf)
	r, _ = http.NewRequest("POST", apiRoot+"/sms/json", b)

	r.Header.Add("Accept", "application/json")
	r.Header.Add("Content-Type", "application/json")

	resp, err := c.client.HTTPClient.Do(r)

	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	body, _ := ioutil.ReadAll(resp.Body)

	err = json.Unmarshal(body, &messageResponse)
	if err != nil {
		return nil, err
	}
	return messageResponse, nil
}
641548
@Override
	public Response sendSMS(String CorpNum, String MgtKey, String Sender,
			String Receiver, String Contents)
			throws PopbillException {
		if (MgtKey == null || MgtKey.isEmpty())
			throw new PopbillException(-99999999, "관리번호가 입력되지 않았습니다.");

		return sendSMS(CorpNum, MgtKey, Sender, Receiver, Contents, null);
	}
1184282
def send(sms_to, sms_body, **kwargs):
    
    headers = {
        "User-Agent": "DBMail/%s" % get_version(),
        'Authorization': 'Basic %s' % b64encode(
            "%s:%s" % (
                settings.IQSMS_API_LOGIN, settings.IQSMS_API_PASSWORD
            )).decode("ascii")
    }

    kwargs.update({
        'phone': sms_to,
        'text': from_unicode(sms_body),
        'sender': kwargs.pop('sms_from', settings.IQSMS_FROM)
    })

    http = HTTPConnection(kwargs.pop("api_url", "gate.iqsms.ru"))
    http.request("GET", "/send/?" + urlencode(kwargs), headers=headers)
    response = http.getresponse()

    if response.status != 200:
        raise IQSMSError(response.reason)

    body = response.read().strip()
    if '=accepted' not in body:
        raise IQSMSError(body)

    return int(body.split('=')[0])
488024
function sendTextMessage(recipientId, textToSend, token) {
      textMessageData = {
        text:textToSend
      }
      request({
        url: FB_MSG_URL,
        qs: {access_token:token},
        method: 'POST',
        json: {
          recipient: {id:recipientId},
          message: textMessageData,
        }
      }, function(error, response, body) {
        if (error) {
          node.log('Error sending text message: ', error);
        } else if (response.body.error) {
          node.log('Error: ', response.body.error);
        }
      });
    }
50077
def _send(self, message):
        

        params = {
            'from': message.from_phone, 
            'to': ",".join(message.to),
            'text': message.body,
            'api_key': self.get_api_key(),
            'api_secret': self.get_api_secret(),
        }


        print(params)

        logger.debug("POST to %r with body: %r", NEXMO_API_URL, params)

        return self.parse(NEXMO_API_URL, requests.post(NEXMO_API_URL, data=params))
1225107
public function sendSMS($from, $to, $message, $send_dt = 0, $wap = '', $flash = 0)
	{
		if(!$send_dt)
			$send_dt = date('Y-m-d H:i:s');
		$d = is_numeric($send_dt) ? $send_dt : strtotime($send_dt);
		$data = array(	'from'=>$from,
						'to'=>$to,
						'message'=>$message,
						'ask_date'=>date(DATE_ISO8601, $d),
						'wap'=>$wap,
						'flash'=>$flash,
						'class_version'=>$this->_version);
		$result = $this->execute('send', $data);
		if(count(@$result['errors']))
			$this->_errors = $result['errors'];
		return @$result['id'];
	}
1319945
public static void sendTextEmail(String to, String from, String subject, String msg, final ServerSetup setup) {
        sendMimeMessage(createTextEmail(to, from, subject, msg, setup));
    }
1329101
def send(sms_to, sms_body, **kwargs):
    
    headers = {
        "Content-type": "application/x-www-form-urlencoded",
        "User-Agent": "DBMail/%s" % get_version(),
        'Authorization': 'Basic %s' % b64encode(
            "%s:%s" % (
                settings.TWILIO_ACCOUNT_SID, settings.TWILIO_AUTH_TOKEN
            )).decode("ascii")

    }

    kwargs.update({
        'From': kwargs.pop('sms_from', settings.TWILIO_FROM),
        'To': sms_to,
        'Body': from_unicode(sms_body)
    })

    http = HTTPSConnection(kwargs.pop("api_url", "api.twilio.com"))
    http.request(
        "POST",
        "/2010-04-01/Accounts/%s/Messages.json" % settings.TWILIO_ACCOUNT_SID,
        headers=headers,
        body=urlencode(kwargs))

    response = http.getresponse()
    if response.status != 201:
        raise TwilioSmsError(response.reason)

    return loads(response.read()).get('sid')
818216
public void sendMessage(String text) throws NotConnectedException, InterruptedException {
        Message message = createMessage();
        message.setBody(text);
        connection.sendStanza(message);
    }