2012-02-07 12 views
8

प्राप्त नहीं हुआ है, मैं एक सी # विंडोज अनुप्रयोग का उपयोग कर एक जीमेल खाते से एक एयरटेल मोबाइल (कर्नाटक में) में एक मुफ्त एसएमएस भेजने की कोशिश कर रहा हूं। संदेश भेजा गया है और मैं भेजे गए आइटम देख सकता हूं, लेकिन यह मोबाइल फोन द्वारा प्राप्त नहीं होता है।एसएमएस गेटवे के माध्यम से ईमेल भेजा गया है, लेकिन

यह मेरा कोड,

SmtpClient smtp = new SmtpClient(); 
smtp.Credentials = new NetworkCredential("[email protected]", "activedust");   
smtp.Port = 587; 
smtp.Host = "smtp.gmail.com"; 
smtp.EnableSsl = true; 
smtp.DeliveryMethod = SmtpDeliveryMethod.Network; 
MailMessage message = new MailMessage(); 

message.To.Add("[email protected]");//replace no with airtel mobile number in Karnataka 

message.From = new MailAddress("[email protected]", "App",System.Text.Encoding.UTF8); 
message.Body = "type your body"; 
message.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure; 
smtp.send(message); 

मैं emaill सफलतापूर्वक इस कोड का उपयोग लेकिन एसएमएस के लिए

+0

कहीं और ईमेल भेजने का प्रयास करें, यह जांचने के लिए कि क्या इसे वास्तव में एसएमएस के बजाय ईमेल के रूप में प्राप्त किया गया है –

+1

एसएमएस गेटवे पर ईमेल विश्वसनीय रूप से संदेशों को वितरित करने में कुख्यात रूप से खराब है। आप वाहक द्वारा अवरुद्ध किया जा सकता है या स्पैम के रूप में चिह्नित किया जा सकता है। –

+0

आपको [smtp] (https://fr.wikipedia.org/wiki/Wikipédia:Oracle/semaine_43_2013#Envoyer_un_SMS_par_e-mail "का उपयोग करने के लिए किसी भी खाते की आवश्यकता नहीं है" बस सत्र उदाहरण देखें; आपको फ्रेंच समझने की आवश्यकता नहीं है इसके लिए")। – user2284570

उत्तर

2

काम नहीं कर आपने कहा मोबाइल नंबर पर इस सेवा को सक्रिय करने के लिए है भेज सकते हैं। यदि यह सक्रिय नहीं है तो आपको मोबाइल पर एसएमएस प्राप्त नहीं होगा, इसके लिए इसे 49/- शुल्क या उसके जैसा कुछ चाहिए।

को सक्रिय नहीं यदि आप को सक्रिय करने और देने की कोशिश फिर से

2

एक दृष्टिकोण की जांच अपने जीमेल खाते

using System.Net; 
using System.Net.Mail; 

public void SendTextMessage(string subject, string message, long telephoneNumer) 
     { 
      // login details for gmail acct. 
      const string sender = "[email protected]"; 
      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); 
       } 
      } 
     } 

साथ एक पाठ संदेश भेजने के लिए एसएमएस द्वार की सूची के लिए किया जाएगा कर सकते हैं http://en.wikipedia.org/wiki/List_of_SMS_gateways

नोट: जब व्यंजन संदेश को प्रतिसाद देता है तो संदेश आपके जीमेल खाते में भेजा जाएगा ... बैकअप के लिए बढ़िया स्माइल | :) और How to send SMS to mobile using SMTP server in windows application?

संबंधित मुद्दे