Coder Social home page Coder Social logo

eksqtr / ejc-sms Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 0.0 11.63 MB

EJC Short Message Service Library based on C# Language and VB .Net in ability to add SMS Feature on your existing project in just few lines of code.

License: GNU General Public License v3.0

C# 51.60% Visual Basic .NET 48.40%

ejc-sms's Introduction

EJS SMS (Short Message Service)

Version 0.5 - March 15, 2020

Available in: C# and VB .Net


Having trouble on making your own Send and Read Messages code for your Project / System using your GSM Modem Device? Say no more. EJC SMS (EJC Short Message Service) is a library uses AT Comamnd that will let you to Send and Read Messages at ease in which helps you to minimized your time developing your system with SMS Feature.


EJC SMS Features

  • Easy to use
  • Code Friendly
  • Ability to Send Single SMS
  • Ability to Send Multiple Recipients
  • Ability to Read Inbox SMS
  • Smart Validiation of Phone Numbers based on Philippines Sim Card Prefixes

EJC SMS Available Functions:

  • InitSMS()

    • Parameter: port_name (string)

    • Initialize the EJC SMS with your Com Port of GSM Modem Device. To get the port you must check it on Device Manager> Ports (Com & LPT)

  • IsValidRecipientNumber()

    • Parameter: recipient_number (string)

    • Return: return as boolean true: means valid false: invalid

    • Smart Validation if the number is valid based on Sim Card Philippines Prefixes.

  • SendSMS()

    • Parameter: recipient_number (string) | recipient_message (string)

    • Return: return as boolean true: means success false: failed

    • Send Single Message to a Recipient.

  • SendMultipleSMS()

    • Parameter: number (List), recipient_message (string)

    • Return: return as integer where it counts number of fail to send to recipient.

    • Send Message to Multiple Recipient.

  • ReadAllMessages()

    • Parameter: None

    • Return: return as DataTable

    • Reads all the Messages in your Sim Card Inbox.


Tutorial on how to use it in C# Language.

Sending Single Message

  • Step 1: Intiantiate the EJCSMS.cs from your form the above of all form control methods.

    • EJCSMS SMS = new EJCSMS(allow_long_msg: true, allow_empty_sms: false);

  • Step 2: On Form_Load Init EJC SMS with your existing port of your GSM Modem Device

    • SMS.InitSMS(GSM_MODEM_PORT); // Initialize the SMS.

  • Step 3: Call the SendSMS() method on SMS Object.

    • SMS.SendSMS("your_phone_number", "your message here");

  • You are done! Easy right?

Sending Message to Multiple Recipient

  • Step 1: Intiantiate the EJCSMS.cs from your form the above of all form control methods.

    • EJCSMS SMS = new EJCSMS(allow_long_msg: true, allow_empty_sms: false);

  • Step 2: On Form_Load Init EJC SMS with your existing port of your GSM Modem Device

    • SMS.InitSMS(GSM_MODEM_PORT); // Initialize the SMS.

  • Step 3: Declare List phonenumba = new List(); and add some phone numbers to it.

    • List< string > phonenumba = new List < string > ();

    • phonenumba.Add("phone_number_1");

    • phonenumba.Add("phone_number_2");

    • phonenumba.Add("phone_number_3");

  • Step 4: After adding phone number on the List you can just call phonenumba and insert it on SMS.SendMultipleSMS first parameter.

    • SMS.SendMultipleSMS(phonenumba, "Your message here");

  • You are done!

How to Read All Messages

  • Step 1: Intiantiate the EJCSMS.cs from your form the above of all form control methods.

    • EJCSMS SMS = new EJCSMS(allow_long_msg: true, allow_empty_sms: false);

  • Step 2: On Form_Load Init EJC SMS with your existing port of your GSM Modem Device

    • SMS.InitSMS(GSM_MODEM_PORT); // Initialize the SMS.

  • Step 3: Create a DatagridView Control on your form. Then just set the datasource just like this.

    • yourDataGridView.DataSource = SMS.ReadAllMesasges();

  • You are done! Easy right? with EJC SMS you can show all SMS in just one line.


Tutorial on how to use it in VB .Net

Sending Single Message

  • Step 1: Intiantiate the EJCSMS.cs from your form the above of all form control methods, And declare string variable for your gsm modem port

    • Dim SMS As New EJCSMS(allow_long_msg:=True, allow_empty_sms:=False)

    • Dim GSM_MODEM_PORT As String = "COM5" ' please change this according to your GSM Modem Port

  • Step 2: On Form_Load Init EJC SMS with your existing port of your GSM Modem Device

    • SMS.InitSMS(GSM_MODEM_PORT) // Initialize the SMS.

  • Step 3: Call the SendSMS() method on SMS Object.

    • SMS.SendSMS("your_phone_number", "your message here")

  • You are done! Easy right?

Sending Message to Multiple Recipient

  • Step 1: Intiantiate the EJCSMS.cs from your form the above of all form control methods, And declare string variable for your gsm modem port

    • Dim SMS As New EJCSMS(allow_long_msg:=True, allow_empty_sms:=False)

    • Dim GSM_MODEM_PORT As String = "COM5" ' please change this according to your GSM Modem Port

  • Step 2: On Form_Load Init EJC SMS with your existing port of your GSM Modem Device

    • SMS.InitSMS(GSM_MODEM_PORT) // Initialize the SMS.

  • Step 3: Declare List phonenumba = new List(); and add some phone numbers to it.

    • Dim recipient_number As New List(Of String)

    • phonenumba.Add("phone_number_1");

    • phonenumba.Add("phone_number_2");

    • phonenumba.Add("phone_number_3");

  • Step 4: After adding phone number on the List you can just call phonenumba and insert it on SMS.SendMultipleSMS first parameter.

    • SMS.SendMultipleSMS(phonenumba, "Your message here")

  • You are done!

How to Read All Messages

  • Step 1: Intiantiate the EJCSMS.cs from your form the above of all form control methods, And declare string variable for your gsm modem port

    • Dim SMS As New EJCSMS(allow_long_msg:=True, allow_empty_sms:=False)

    • Dim GSM_MODEM_PORT As String = "COM5" ' please change this according to your GSM Modem Port

  • Step 2: On Form_Load Init EJC SMS with your existing port of your GSM Modem Device

    • SMS.InitSMS(GSM_MODEM_PORT) // Initialize the SMS.

  • Step 3: Create a DatagridView Control on your form. Then just set the datasource just like this.

    • yourDataGridView.DataSource = SMS.ReadAllMesasges()

  • You are done! Easy right? with EJC SMS you can show all SMS in just one line.


SMS Sending error? or No SMS receive?

You can check EJC_SMS Directory folder inside of your respective project (/bin/debug/EJC_SMS). There you can find debug.txt and error.txt allowing you to determine what cause your SMS fail in some events.

Directory Folder:

Directory

Debug:

DebugTxt

Error:

ErrorTxt


I made an example System on how to use this EJC SMS

Singe Recipient

SendSMSSingle SendSMSSingleProof

Multiple Recipient

SendSMSMultiple SendSMSMultipleProof

Reading SMS

ReadSMS

Back-end and Front-end developed by: EJC

ejc-sms's People

Contributors

eksqtr avatar

Stargazers

 avatar Reniel George Mababa avatar Prateek Chaubey avatar John Moremm L. Abuyabor avatar Rafael Mizar Zita avatar Paul Justin Aranzamendez avatar

Watchers

James Cloos avatar Edward Garcia avatar  avatar

ejc-sms's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.