Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to Send sms using Internet in c#.I tried diff. technique posted by diff. author's but was unsuccessfull. If u hav any sol. plz help Me.
Thank you
Posted
Comments
CHill60 13-Feb-13 4:58am    
The trouble is if you don't post the code that "was unsuccessfull" we don't know what you've tried. You will end up with solutions that just contain links to various articles and sample code that you may have already seen. At worst someone will post a "let me google that for you" search. Try using the Improve question widget to add some more detail to your question
OriginalGriff 13-Feb-13 5:02am    
"At worst someone will post a "let me google that for you" search"

Don't tempt me! :laugh:
CHill60 13-Feb-13 5:04am    
I was very very tempted ... but the site was down :-(
OriginalGriff 13-Feb-13 5:06am    
It's working now - and so is LetMeBingThatForYou. :laugh:

One approach would be to send a text message with your gmail account

C#
using System.Net;
using System.Net.Mail;

public void SendTextMessage(string subject, string message, long telephoneNumer)
        {
            // login details for gmail acct.
            const string sender = "me@gmail.com";
            const string password = "mypassword4gmailacct";

            // find the carriers sms gateway for the recipent. txt.att.net is for AT&T customers.
            string carrierGateway = "txt.att.net";

            // this is the recipents number @ carrierGateway that gmail use to deliver message.
            string recipent = string.Concat(new object[]{
            telephoneNumer,
            '@',
            carrierGateway
            });

            // form the text message and send
            using (MailMessage textMessage = new MailMessage(sender, recipent, subject, message))
            {
                using (SmtpClient textMessageClient = new SmtpClient("smtp.gmail.com", 587))
                {
                    textMessageClient.UseDefaultCredentials = false;
                    textMessageClient.EnableSsl = true;
                    textMessageClient.Credentials = new NetworkCredential(sender, password);
                    textMessageClient.Send(textMessage);
                }
            }
        }


For a List of Sms Gateways check http://en.wikipedia.org/wiki/List_of_SMS_gateways[^]

Note: When the recipent responds to the message the message will be sent to your gmail account...Great for backups :-)
 
Share this answer
 
v4
Have a look at this link[^]

In particular look for the responses from AlexFeinman but especially from saslic
 
Share this answer
 
Sending SMS using your way2sms account

Use smsClient.dll for sending sms using your way2sms account

You can download smsClient.dll from the following link

http://skdotnetdeveloper.blogspot.in/2011/09/send-sms-in-cnet.html

Add reference of this dll and use this following code for sending the sms

SmsClient.SendSms sms = new SmsClient.SendSms();
//string status=sms.send(way2smsuserid, way2smspassword, message, tonumber);
 
Share this answer
 
Comments
charles henington 13-Feb-13 23:46pm    
mistakenly voted a 3 and wont let me change to a 1 so consider this one a gift but the reson for this vote is that way2sms only works in India
Renju Vinod 14-Feb-13 0:37am    
@charles henington - Actually this question is asked by "Raj Vishwakarma15425" he is in India so this code will work fine for him
Umair Ali Ghumman 25-Jun-14 14:22pm    
any help for pakistani.....?????? :(
Member 12667863 22-Aug-16 7:00am    
haha no help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900