Example #1
0
        /// <summary>
        /// 傳送文字簡訊。立即傳送。
        /// </summary>
        /// <param name="phoneNumber">接收門號</param>
        /// <param name="content">簡訊內容</param>
        /// <returns>Message ID (用於查詢傳送結果)</returns>
        public string SendTextMessage(
            string phoneNumber,
            string content
            )
        {
            var request = new SendTextMessageRequest(
                phoneNumber,
                content);

            var response = this.SendRequest <SendMessageResponse>(
                request,
                b => new SendMessageResponse(b)
                );

            return(response.GetMessageID());
        }
Example #2
0
        /// <summary>
        /// 傳送文字簡訊。預約傳送加重送截止時間。
        /// </summary>
        /// <param name="phoneNumber">接收門號</param>
        /// <param name="content">簡訊內容</param>
        /// <param name="scheduled">預約時間</param>
        /// <param name="deadline">重送截止時間</param>
        public string SendTextMessage(
            string phoneNumber,
            string content,
            DateTime scheduled,
            TimeSpan deadline
            )
        {
            var request = new SendTextMessageRequest(
                phoneNumber,
                content,
                scheduled,
                deadline);

            var response = this.SendRequest <SendMessageResponse>(
                request,
                b => new SendMessageResponse(b)
                );

            return(response.GetMessageID());
        }