Ejemplo n.º 1
0
        protected void SendMessage_Click(object sender, EventArgs e)
        {
            IntelliSMS objIntelliSMS = new IntelliSMS();

            objIntelliSMS.Username = "******";
            objIntelliSMS.Password = "******";

            string phone = Convert.ToString(ToTextBox.Text);

            String MessageId = objIntelliSMS.SendMsg(phone,SMSText.Text, From.Text);

            messageid.InnerHtml = "Message Sent Succesfully";

            //MMSMessage NewMMSMessage = new MMSMessage();
            //NewMMSMessage.Subject = "MMS Message Subject";
            ////MessagePart MessagePart1 = new MessagePart();
            ////MessagePart1.SourceFilename = "C:\Image1.gif";
            ////NewMMSMessage.MessageParts.Add ( MessagePart1 );
            //MessagePart MessagePart2 = new MessagePart();
            //MessagePart2.Filename = "Text1.txt";
            //MessagePart2.Text = Text.Text;
            //NewMMSMessage.MessageParts.Add ( MessagePart2 );
            //IntelliSMS objIntelliSMS = new IntelliSMS();
            //objIntelliSMS.Username = "******";
            //objIntelliSMS.Password = "******";
            //StringCollection ToList = new StringCollection();
            //ToList.Add (To.Text);
            //SendStatusCollection SendStatusList;
            //SendStatusList = objIntelliSMS.SendMMSMessage
            //( ToList, NewMMSMessage );
        }
Ejemplo n.º 2
0
 public static void sendMessage(SMJob job)
 {
     var objIntelliSMS = new IntelliSMS();
     var _context = new Context();
     objIntelliSMS.Username = "******";
     objIntelliSMS.Password = "******";
     Trace.WriteLine(job.Company);
     Company c = _context.getCompany(job.Company);
     String message = job.Techs + " will be late to " + job.Name + " scheduled for " + job.Time;
     Trace.WriteLine("phone " + c.Phone + " message = " + message);
     // String messageId = objIntelliSMS.SendMsg
     //     (c.Phone, message, "SENDER_ID");
     // Trace.WriteLine("sent msg with id "+messageId);
 }
        // us kithmini pw i43Android
        public bool sendmsg(string username, string password, string cno, string msg)
        {
            try
            {
                IntelliSMS objIntelliSMS = new IntelliSMS();

                objIntelliSMS.Username = username;
                objIntelliSMS.Password = password;

                string messsage = msg;

                // String MessageId = objIntelliSMS.SendMsg(cno, messsage, "our number with +94764181619");



                StringCollection ToList = new StringCollection();
                ToList.Add("+94764181619");

                SendStatusCollection SendStatusList;

                SendStatusList = objIntelliSMS.SendMsgToMultipleRecipients
                                     (ToList, messsage, "+94764181619");


                string Report = "";
                foreach (SendStatus sendStatus in SendStatusList)
                {
                    Report += "To:" + sendStatus.To + ", " + "ResultCode:" + sendStatus.ResultCode + "\n";
                }

                MessageBox.Show(Report, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);

                return(true);
            }
            catch (IntelliSMSException)
            {
                return(false);
                //ResultCodes resualt = new ResultCodes();
                //throw new IntelliSMSException(resualt, ex.ToString());
            }
            catch (Exception)
            {
                return(false);
                //throw new Exception();
            }
        }
    //Method for sending SMS via IntelliSMS
    protected void sendSMS(string msg)
    {
        IntelliSMS objIntelliSMS = new IntelliSMS();

        objIntelliSMS.Username = "******";
        objIntelliSMS.Password = "******";
        int Balance = objIntelliSMS.GetBalance();

        String MessageId = objIntelliSMS.SendMsg
            ( "44775...", msg + "Your remaining credit is: " + Balance, "ZOYA" );
    }