Example #1
0
 private void SendSmsMessage(string username, MessageObject messageObj)
 {
     const string senderNumber = "+17245658130";
     var twilioRestClient = new TwilioRestClient("AC47c7253af8c6fae4066c7fe3dbe4433c", "[AuthToken]");
     var recipientNumber = Utils.GetNum(username);
     twilioRestClient.SendMessage(senderNumber, recipientNumber, messageObj.ShortMessage, MessageCallback);
 }
Example #2
0
        private void SendSMTPMessage(string username, MessageObject messageObj)
        {
            var mailClient = new SmtpClient("smtp.acme.net");
            mailClient.Credentials = new NetworkCredential("*****@*****.**", "[Password]");

            var name = Utils.GetDisplayName(username).Trim();
            var address = Utils.GetEmailAddress(username);
            var addr2 = new MailAddress(address, name);

            var mailAddress = new MailAddress("*****@*****.**", "Acme MailRoom");
            var msg = new MailMessage(mailAddress, addr2);

            msg.Subject = messageObj.Subject;
            msg.Body = messageObj.Message;

            mailClient.Send(msg);
        }
Example #3
0
 private void SendInAppMessage(string username, MessageObject messageObj)
 {
     new AppInbox(username).Send(messageObj.Subject, messageObj.Message);
 }