Can I send SMS Messages from a C# Application?

Lloyd picture Lloyd · Jul 6, 2015 · Viewed 42.9k times · Source

I'm looking to build a program that would allow me to send SMS messages directly from the C# Application. I intend to build an 'Automatic Appointment Reminder' system that would automatically send SMS messages to recipients' mobile phones notifying them of their upcoming appointment.

Could anyone advise on how I would implement this type of feature as I have no experience in 'Mobile Communications' and mobile connectivity with desktop applications.

My carrier is EE (If that helps?)

Any help would be greatly appreciated.

Answer

P.Brian.Mackey picture P.Brian.Mackey · Jul 6, 2015

Most major carriers offer an email to text service. The program can use email to send an SMS message. For example:

Send an email

var message = new MailMessage();
message.From = new MailAddress("[email protected]");

message.To.Add(new MailAddress("[email protected]"));//See carrier destinations below
//message.To.Add(new MailAddress("[email protected]"));

//message.CC.Add(new MailAddress("[email protected]"));
message.Subject = "This is my subject";
message.Body = "This is the content";

var client = new SmtpClient();
client.Send(message);

Carrier destinations

  • ATT: Compose a new email and use the recipient's 10-digit wireless phone number, followed by @txt.att.net. For example, [email protected].
  • Verizon: Similarly, ##@vtext.com
  • Sprint: ##@messaging.sprintpcs.com
  • TMobile: ##@tmomail.net
  • Virgin Mobile: ##@vmobl.com
  • Nextel: ##@messaging.nextel.com
  • Boost: ##@myboostmobile.com
  • Alltel: ##@message.alltel.com
  • EE: ##@mms.ee.co.uk (might support send without reply-to)

Alternatives

  • There are vendors that provide SMS messaging service via an API