We schedule our work emails all the time so why not do it with personal texts as well? Here are some of the best apps to automated text message on Android and iOS. Bearing that in mind, as you test your version of the code, be mindful of expenses you may be generating for yourself (if, for example, you are sending messages to yourself) or another person.Texting people at odd hours is considered rude but waiting until morning and risk forgetting it, is even worse. For example, if you were tasked with writing an application that monitored some sort of trend information such as a daily stock price, and were to alert a group of end users whenever the stock price exceeded some predetermined, agreed upon value, you could do something such as looping through a collection of users subscribing to the stock price monitoring service and direct a text message to each of these users indicating that the watched stock had surpassed the threshold value.Īlso please note that, whilst it does cost you a dime to send a message to a cell phone in this manner, it may well cost the recipient something to receive it. Even though this example was intended to be simple, the overall concept may be used within an application to do some seemingly complex jobs. // Upon user's request, close the applicationĪt this point, the application should be complete you may wish to build the solution and test it.MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error).MessageBox.Show( "The mail message has been sent to " & message.To.ToString(), "Mail" , MessageBoxButtons.OK, MessageBoxIcon.Information).mySmtpClient.UseDefaultCredentials = True.SmtpClient mySmtpClient = new SmtpClient(mMailServer).MailMessage message = new MailMessage(mFrom, mTo, mSubject, mMsg).// Within a try catch, format and send the message to.mMailServer = Trim(txtMailServer.Text).mTo = Trim(txtPhoneNumber.Text) & Trim(()).// Collect user input from the form and stow content into.private void btnSend_Click(System.Object sender, System.EventArgs e).// research the topic and add others, it took a while to generate this.// set up the carriers list - this is a fair list, you may wish to.private void frmMain_Load(System.Object sender, System.EventArgs e).The following imports were added to the top of the class: The following figure (Figure 1) shows a properly configured collection of input fields in use:įigure 1: The Demonstration Application in UseĪ quick review of the code will reveal that there is little going on there. To maintain the simplicity of the project, little in the way of error handling has been included. The application is simple but could easily be improved by validating each of the required fields through the use of regular expressions or by at least validating that the text associated with each of the text boxes is not an empty string. Message Body: Captures the sender's message content.Message Subject Line: Captures the message's title or subject.
0 Comments
Leave a Reply. |