How to obtain Google login session cookie and later use it to send SMS via Google Voice service with C# Windows application?









up vote
0
down vote

favorite












I'm trying to send a text message from my C# application in Windows using Google Voice service. I found this code sample (I'll quote it below) but it doesn't work -- the code always throws an exception, "Unable to get the Session-id field from Google."



using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;


namespace TestGoogleVoiceTxt

class Program

static void Main(string args)

Console.WriteLine("Preparing to send a text message...");

try

Jitbit.Utils.SharpGoogleVoice sgv = new Jitbit.Utils.SharpGoogleVoice("myemailaddress@gmail.com", "mypassword");

sgv.SendSMS("+11234567890", "Test from C#");

Console.WriteLine("Msg was sent OK.");

catch (Exception ex)

Console.WriteLine("ERROR: " + ex.Message);








namespace Jitbit.Utils

class SharpGoogleVoice

private CookieWebClient _webClient;

private string _rnrse;

private string _username;
private string _password;

private const string USERAGENT = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11 Safari/525.20";

public SharpGoogleVoice(string username, string password)

_username = username;
_password = password;
_webClient = new CookieWebClient();


private void Login()

_webClient.Headers.Add("User-agent", USERAGENT); //mobile user agent to save bandwidth (google will serve mobile version of the page)

//get "GALX" field value from google login page
string response = Encoding.ASCII.GetString(_webClient.DownloadData("https://accounts.google.com/ServiceLogin?service=grandcentral"));
Regex galxRegex = new Regex(@"name=""GALX"".*?value=""(.*?)""", RegexOptions.Singleline);
string galx = galxRegex.Match(response).Groups[1].Value;

//Check the response that is received from Google:
// -- this is a login screen
// System.IO.File.WriteAllText(@"I:GoogleResponse.html", response, Encoding.UTF8);

//sending login info
_webClient.Headers.Add("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
_webClient.Headers.Add("User-agent", USERAGENT); //mobile user agent to save bandwidth (google will serve mobile version of the page)
byte responseArray = _webClient.UploadData(
"https://accounts.google.com/ServiceLogin?service=grandcentral",
"POST",
PostParameters(new Dictionary<string, string>

"Email", _username,
"Passwd", _password,
"GALX", galx,
"PersistentCookie", "yes"
));
response = Encoding.ASCII.GetString(responseArray);


/// <summary>
/// creates a byte-array ready to be sent with a POST-request
/// </summary>
private static byte PostParameters(IDictionary<string, string> parameters)

string paramStr = "";

foreach (string key in parameters.Keys)

paramStr += key + "=" + HttpUtility.UrlEncode(parameters[key]) + "&";


return Encoding.ASCII.GetBytes(paramStr);


private void TryGetRNRSE()

if (!GetRNRSE())

//we can't find the required field on the page. Probably we're logged out. Let's try to login
Login();
if (!GetRNRSE())

throw new Exception("Unable to get the Session-id field from Google.");




/// <summary>
/// Gets google's "session id" hidden-field value
/// </summary>
private bool GetRNRSE()

_webClient.Headers.Add("User-agent", USERAGENT); //mobile user agent to save bandwidth (google will serve mobile version of the page)

//get goovle voice "homepage" (mobile version - to save bandwidth)
string response = Encoding.ASCII.GetString(_webClient.DownloadData("https://www.google.com/voice/m"));

//find the hidden field
Regex rnrRegex = new Regex(@"<input.*?name=""_rnr_se"".*?value=""(.*?)""");
if (rnrRegex.IsMatch(response))

_rnrse = rnrRegex.Match(response).Groups[1].Value;
return true;

return false;



/// <summary>
/// Send s text-message to teh specified number
/// </summary>
/// <param name="number">Phone number in '+1234567890'-format </param>
/// <param name="text">Message text</param>
public void SendSMS(string number, string text)

if (!ValidateNumber(number))
throw new FormatException("Wrong number format. Should be '+1234567890'. Please try again.");

TryGetRNRSE();

text = text.Length <= 160 ? text : text.Substring(0, 160);

byte parameters = PostParameters(new Dictionary<string, string>

"phoneNumber", number,
"text", text,
"_rnr_se", _rnrse
);

_webClient.Headers.Add("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
byte responseArray = _webClient.UploadData("https://www.google.com/voice/sms/send", "POST", parameters);
string response = Encoding.ASCII.GetString(responseArray);

if (response.IndexOf(""ok":true") == -1)
throw new Exception("Google did not answer with an OK responsenn"+response);


public static bool ValidateNumber(string number)

if (number == null) return false;
return Regex.IsMatch(number, @"^+d11$");



[System.ComponentModel.DesignerCategory("Code")] //to fix the annoying VS "subtype" issue
internal class CookieWebClient : System.Net.WebClient

private CookieContainer _cookieContainer = new CookieContainer();
public CookieContainer CookieContainer

get return _cookieContainer;
set _cookieContainer = value;


protected override WebRequest GetWebRequest(Uri address)

WebRequest request = base.GetWebRequest(address);
if (request is HttpWebRequest)

(request as HttpWebRequest).CookieContainer = _cookieContainer;

return request;





I did some debugging of that script and if I put a breakpoint in the Login() function and save the response from the accounts.google.com/ServiceLogin?service=grandcentral page (as I showed in the code above) the page returned by the service ("GoogleResponse.html" file contents) is this:



enter image description here



So it is clearly wanting me to login there instead of doing the "hack" that the author of that script was trying to achieve.



So my question is how do I incorporate that into my application?



PS. My assumption is that I need to somehow display that login script in a popup web browser page from my app, then somehow collect a login session ID from it after the user enters the email and password, and then use it for further requests to send the SMS. Any pointers will be appreciated...










share|improve this question

























    up vote
    0
    down vote

    favorite












    I'm trying to send a text message from my C# application in Windows using Google Voice service. I found this code sample (I'll quote it below) but it doesn't work -- the code always throws an exception, "Unable to get the Session-id field from Google."



    using System;
    using System.Collections.Generic;
    using System.Net;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Web;


    namespace TestGoogleVoiceTxt

    class Program

    static void Main(string args)

    Console.WriteLine("Preparing to send a text message...");

    try

    Jitbit.Utils.SharpGoogleVoice sgv = new Jitbit.Utils.SharpGoogleVoice("myemailaddress@gmail.com", "mypassword");

    sgv.SendSMS("+11234567890", "Test from C#");

    Console.WriteLine("Msg was sent OK.");

    catch (Exception ex)

    Console.WriteLine("ERROR: " + ex.Message);








    namespace Jitbit.Utils

    class SharpGoogleVoice

    private CookieWebClient _webClient;

    private string _rnrse;

    private string _username;
    private string _password;

    private const string USERAGENT = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11 Safari/525.20";

    public SharpGoogleVoice(string username, string password)

    _username = username;
    _password = password;
    _webClient = new CookieWebClient();


    private void Login()

    _webClient.Headers.Add("User-agent", USERAGENT); //mobile user agent to save bandwidth (google will serve mobile version of the page)

    //get "GALX" field value from google login page
    string response = Encoding.ASCII.GetString(_webClient.DownloadData("https://accounts.google.com/ServiceLogin?service=grandcentral"));
    Regex galxRegex = new Regex(@"name=""GALX"".*?value=""(.*?)""", RegexOptions.Singleline);
    string galx = galxRegex.Match(response).Groups[1].Value;

    //Check the response that is received from Google:
    // -- this is a login screen
    // System.IO.File.WriteAllText(@"I:GoogleResponse.html", response, Encoding.UTF8);

    //sending login info
    _webClient.Headers.Add("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
    _webClient.Headers.Add("User-agent", USERAGENT); //mobile user agent to save bandwidth (google will serve mobile version of the page)
    byte responseArray = _webClient.UploadData(
    "https://accounts.google.com/ServiceLogin?service=grandcentral",
    "POST",
    PostParameters(new Dictionary<string, string>

    "Email", _username,
    "Passwd", _password,
    "GALX", galx,
    "PersistentCookie", "yes"
    ));
    response = Encoding.ASCII.GetString(responseArray);


    /// <summary>
    /// creates a byte-array ready to be sent with a POST-request
    /// </summary>
    private static byte PostParameters(IDictionary<string, string> parameters)

    string paramStr = "";

    foreach (string key in parameters.Keys)

    paramStr += key + "=" + HttpUtility.UrlEncode(parameters[key]) + "&";


    return Encoding.ASCII.GetBytes(paramStr);


    private void TryGetRNRSE()

    if (!GetRNRSE())

    //we can't find the required field on the page. Probably we're logged out. Let's try to login
    Login();
    if (!GetRNRSE())

    throw new Exception("Unable to get the Session-id field from Google.");




    /// <summary>
    /// Gets google's "session id" hidden-field value
    /// </summary>
    private bool GetRNRSE()

    _webClient.Headers.Add("User-agent", USERAGENT); //mobile user agent to save bandwidth (google will serve mobile version of the page)

    //get goovle voice "homepage" (mobile version - to save bandwidth)
    string response = Encoding.ASCII.GetString(_webClient.DownloadData("https://www.google.com/voice/m"));

    //find the hidden field
    Regex rnrRegex = new Regex(@"<input.*?name=""_rnr_se"".*?value=""(.*?)""");
    if (rnrRegex.IsMatch(response))

    _rnrse = rnrRegex.Match(response).Groups[1].Value;
    return true;

    return false;



    /// <summary>
    /// Send s text-message to teh specified number
    /// </summary>
    /// <param name="number">Phone number in '+1234567890'-format </param>
    /// <param name="text">Message text</param>
    public void SendSMS(string number, string text)

    if (!ValidateNumber(number))
    throw new FormatException("Wrong number format. Should be '+1234567890'. Please try again.");

    TryGetRNRSE();

    text = text.Length <= 160 ? text : text.Substring(0, 160);

    byte parameters = PostParameters(new Dictionary<string, string>

    "phoneNumber", number,
    "text", text,
    "_rnr_se", _rnrse
    );

    _webClient.Headers.Add("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
    byte responseArray = _webClient.UploadData("https://www.google.com/voice/sms/send", "POST", parameters);
    string response = Encoding.ASCII.GetString(responseArray);

    if (response.IndexOf(""ok":true") == -1)
    throw new Exception("Google did not answer with an OK responsenn"+response);


    public static bool ValidateNumber(string number)

    if (number == null) return false;
    return Regex.IsMatch(number, @"^+d11$");



    [System.ComponentModel.DesignerCategory("Code")] //to fix the annoying VS "subtype" issue
    internal class CookieWebClient : System.Net.WebClient

    private CookieContainer _cookieContainer = new CookieContainer();
    public CookieContainer CookieContainer

    get return _cookieContainer;
    set _cookieContainer = value;


    protected override WebRequest GetWebRequest(Uri address)

    WebRequest request = base.GetWebRequest(address);
    if (request is HttpWebRequest)

    (request as HttpWebRequest).CookieContainer = _cookieContainer;

    return request;





    I did some debugging of that script and if I put a breakpoint in the Login() function and save the response from the accounts.google.com/ServiceLogin?service=grandcentral page (as I showed in the code above) the page returned by the service ("GoogleResponse.html" file contents) is this:



    enter image description here



    So it is clearly wanting me to login there instead of doing the "hack" that the author of that script was trying to achieve.



    So my question is how do I incorporate that into my application?



    PS. My assumption is that I need to somehow display that login script in a popup web browser page from my app, then somehow collect a login session ID from it after the user enters the email and password, and then use it for further requests to send the SMS. Any pointers will be appreciated...










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm trying to send a text message from my C# application in Windows using Google Voice service. I found this code sample (I'll quote it below) but it doesn't work -- the code always throws an exception, "Unable to get the Session-id field from Google."



      using System;
      using System.Collections.Generic;
      using System.Net;
      using System.Text;
      using System.Text.RegularExpressions;
      using System.Web;


      namespace TestGoogleVoiceTxt

      class Program

      static void Main(string args)

      Console.WriteLine("Preparing to send a text message...");

      try

      Jitbit.Utils.SharpGoogleVoice sgv = new Jitbit.Utils.SharpGoogleVoice("myemailaddress@gmail.com", "mypassword");

      sgv.SendSMS("+11234567890", "Test from C#");

      Console.WriteLine("Msg was sent OK.");

      catch (Exception ex)

      Console.WriteLine("ERROR: " + ex.Message);








      namespace Jitbit.Utils

      class SharpGoogleVoice

      private CookieWebClient _webClient;

      private string _rnrse;

      private string _username;
      private string _password;

      private const string USERAGENT = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11 Safari/525.20";

      public SharpGoogleVoice(string username, string password)

      _username = username;
      _password = password;
      _webClient = new CookieWebClient();


      private void Login()

      _webClient.Headers.Add("User-agent", USERAGENT); //mobile user agent to save bandwidth (google will serve mobile version of the page)

      //get "GALX" field value from google login page
      string response = Encoding.ASCII.GetString(_webClient.DownloadData("https://accounts.google.com/ServiceLogin?service=grandcentral"));
      Regex galxRegex = new Regex(@"name=""GALX"".*?value=""(.*?)""", RegexOptions.Singleline);
      string galx = galxRegex.Match(response).Groups[1].Value;

      //Check the response that is received from Google:
      // -- this is a login screen
      // System.IO.File.WriteAllText(@"I:GoogleResponse.html", response, Encoding.UTF8);

      //sending login info
      _webClient.Headers.Add("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
      _webClient.Headers.Add("User-agent", USERAGENT); //mobile user agent to save bandwidth (google will serve mobile version of the page)
      byte responseArray = _webClient.UploadData(
      "https://accounts.google.com/ServiceLogin?service=grandcentral",
      "POST",
      PostParameters(new Dictionary<string, string>

      "Email", _username,
      "Passwd", _password,
      "GALX", galx,
      "PersistentCookie", "yes"
      ));
      response = Encoding.ASCII.GetString(responseArray);


      /// <summary>
      /// creates a byte-array ready to be sent with a POST-request
      /// </summary>
      private static byte PostParameters(IDictionary<string, string> parameters)

      string paramStr = "";

      foreach (string key in parameters.Keys)

      paramStr += key + "=" + HttpUtility.UrlEncode(parameters[key]) + "&";


      return Encoding.ASCII.GetBytes(paramStr);


      private void TryGetRNRSE()

      if (!GetRNRSE())

      //we can't find the required field on the page. Probably we're logged out. Let's try to login
      Login();
      if (!GetRNRSE())

      throw new Exception("Unable to get the Session-id field from Google.");




      /// <summary>
      /// Gets google's "session id" hidden-field value
      /// </summary>
      private bool GetRNRSE()

      _webClient.Headers.Add("User-agent", USERAGENT); //mobile user agent to save bandwidth (google will serve mobile version of the page)

      //get goovle voice "homepage" (mobile version - to save bandwidth)
      string response = Encoding.ASCII.GetString(_webClient.DownloadData("https://www.google.com/voice/m"));

      //find the hidden field
      Regex rnrRegex = new Regex(@"<input.*?name=""_rnr_se"".*?value=""(.*?)""");
      if (rnrRegex.IsMatch(response))

      _rnrse = rnrRegex.Match(response).Groups[1].Value;
      return true;

      return false;



      /// <summary>
      /// Send s text-message to teh specified number
      /// </summary>
      /// <param name="number">Phone number in '+1234567890'-format </param>
      /// <param name="text">Message text</param>
      public void SendSMS(string number, string text)

      if (!ValidateNumber(number))
      throw new FormatException("Wrong number format. Should be '+1234567890'. Please try again.");

      TryGetRNRSE();

      text = text.Length <= 160 ? text : text.Substring(0, 160);

      byte parameters = PostParameters(new Dictionary<string, string>

      "phoneNumber", number,
      "text", text,
      "_rnr_se", _rnrse
      );

      _webClient.Headers.Add("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
      byte responseArray = _webClient.UploadData("https://www.google.com/voice/sms/send", "POST", parameters);
      string response = Encoding.ASCII.GetString(responseArray);

      if (response.IndexOf(""ok":true") == -1)
      throw new Exception("Google did not answer with an OK responsenn"+response);


      public static bool ValidateNumber(string number)

      if (number == null) return false;
      return Regex.IsMatch(number, @"^+d11$");



      [System.ComponentModel.DesignerCategory("Code")] //to fix the annoying VS "subtype" issue
      internal class CookieWebClient : System.Net.WebClient

      private CookieContainer _cookieContainer = new CookieContainer();
      public CookieContainer CookieContainer

      get return _cookieContainer;
      set _cookieContainer = value;


      protected override WebRequest GetWebRequest(Uri address)

      WebRequest request = base.GetWebRequest(address);
      if (request is HttpWebRequest)

      (request as HttpWebRequest).CookieContainer = _cookieContainer;

      return request;





      I did some debugging of that script and if I put a breakpoint in the Login() function and save the response from the accounts.google.com/ServiceLogin?service=grandcentral page (as I showed in the code above) the page returned by the service ("GoogleResponse.html" file contents) is this:



      enter image description here



      So it is clearly wanting me to login there instead of doing the "hack" that the author of that script was trying to achieve.



      So my question is how do I incorporate that into my application?



      PS. My assumption is that I need to somehow display that login script in a popup web browser page from my app, then somehow collect a login session ID from it after the user enters the email and password, and then use it for further requests to send the SMS. Any pointers will be appreciated...










      share|improve this question













      I'm trying to send a text message from my C# application in Windows using Google Voice service. I found this code sample (I'll quote it below) but it doesn't work -- the code always throws an exception, "Unable to get the Session-id field from Google."



      using System;
      using System.Collections.Generic;
      using System.Net;
      using System.Text;
      using System.Text.RegularExpressions;
      using System.Web;


      namespace TestGoogleVoiceTxt

      class Program

      static void Main(string args)

      Console.WriteLine("Preparing to send a text message...");

      try

      Jitbit.Utils.SharpGoogleVoice sgv = new Jitbit.Utils.SharpGoogleVoice("myemailaddress@gmail.com", "mypassword");

      sgv.SendSMS("+11234567890", "Test from C#");

      Console.WriteLine("Msg was sent OK.");

      catch (Exception ex)

      Console.WriteLine("ERROR: " + ex.Message);








      namespace Jitbit.Utils

      class SharpGoogleVoice

      private CookieWebClient _webClient;

      private string _rnrse;

      private string _username;
      private string _password;

      private const string USERAGENT = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11 Safari/525.20";

      public SharpGoogleVoice(string username, string password)

      _username = username;
      _password = password;
      _webClient = new CookieWebClient();


      private void Login()

      _webClient.Headers.Add("User-agent", USERAGENT); //mobile user agent to save bandwidth (google will serve mobile version of the page)

      //get "GALX" field value from google login page
      string response = Encoding.ASCII.GetString(_webClient.DownloadData("https://accounts.google.com/ServiceLogin?service=grandcentral"));
      Regex galxRegex = new Regex(@"name=""GALX"".*?value=""(.*?)""", RegexOptions.Singleline);
      string galx = galxRegex.Match(response).Groups[1].Value;

      //Check the response that is received from Google:
      // -- this is a login screen
      // System.IO.File.WriteAllText(@"I:GoogleResponse.html", response, Encoding.UTF8);

      //sending login info
      _webClient.Headers.Add("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
      _webClient.Headers.Add("User-agent", USERAGENT); //mobile user agent to save bandwidth (google will serve mobile version of the page)
      byte responseArray = _webClient.UploadData(
      "https://accounts.google.com/ServiceLogin?service=grandcentral",
      "POST",
      PostParameters(new Dictionary<string, string>

      "Email", _username,
      "Passwd", _password,
      "GALX", galx,
      "PersistentCookie", "yes"
      ));
      response = Encoding.ASCII.GetString(responseArray);


      /// <summary>
      /// creates a byte-array ready to be sent with a POST-request
      /// </summary>
      private static byte PostParameters(IDictionary<string, string> parameters)

      string paramStr = "";

      foreach (string key in parameters.Keys)

      paramStr += key + "=" + HttpUtility.UrlEncode(parameters[key]) + "&";


      return Encoding.ASCII.GetBytes(paramStr);


      private void TryGetRNRSE()

      if (!GetRNRSE())

      //we can't find the required field on the page. Probably we're logged out. Let's try to login
      Login();
      if (!GetRNRSE())

      throw new Exception("Unable to get the Session-id field from Google.");




      /// <summary>
      /// Gets google's "session id" hidden-field value
      /// </summary>
      private bool GetRNRSE()

      _webClient.Headers.Add("User-agent", USERAGENT); //mobile user agent to save bandwidth (google will serve mobile version of the page)

      //get goovle voice "homepage" (mobile version - to save bandwidth)
      string response = Encoding.ASCII.GetString(_webClient.DownloadData("https://www.google.com/voice/m"));

      //find the hidden field
      Regex rnrRegex = new Regex(@"<input.*?name=""_rnr_se"".*?value=""(.*?)""");
      if (rnrRegex.IsMatch(response))

      _rnrse = rnrRegex.Match(response).Groups[1].Value;
      return true;

      return false;



      /// <summary>
      /// Send s text-message to teh specified number
      /// </summary>
      /// <param name="number">Phone number in '+1234567890'-format </param>
      /// <param name="text">Message text</param>
      public void SendSMS(string number, string text)

      if (!ValidateNumber(number))
      throw new FormatException("Wrong number format. Should be '+1234567890'. Please try again.");

      TryGetRNRSE();

      text = text.Length <= 160 ? text : text.Substring(0, 160);

      byte parameters = PostParameters(new Dictionary<string, string>

      "phoneNumber", number,
      "text", text,
      "_rnr_se", _rnrse
      );

      _webClient.Headers.Add("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
      byte responseArray = _webClient.UploadData("https://www.google.com/voice/sms/send", "POST", parameters);
      string response = Encoding.ASCII.GetString(responseArray);

      if (response.IndexOf(""ok":true") == -1)
      throw new Exception("Google did not answer with an OK responsenn"+response);


      public static bool ValidateNumber(string number)

      if (number == null) return false;
      return Regex.IsMatch(number, @"^+d11$");



      [System.ComponentModel.DesignerCategory("Code")] //to fix the annoying VS "subtype" issue
      internal class CookieWebClient : System.Net.WebClient

      private CookieContainer _cookieContainer = new CookieContainer();
      public CookieContainer CookieContainer

      get return _cookieContainer;
      set _cookieContainer = value;


      protected override WebRequest GetWebRequest(Uri address)

      WebRequest request = base.GetWebRequest(address);
      if (request is HttpWebRequest)

      (request as HttpWebRequest).CookieContainer = _cookieContainer;

      return request;





      I did some debugging of that script and if I put a breakpoint in the Login() function and save the response from the accounts.google.com/ServiceLogin?service=grandcentral page (as I showed in the code above) the page returned by the service ("GoogleResponse.html" file contents) is this:



      enter image description here



      So it is clearly wanting me to login there instead of doing the "hack" that the author of that script was trying to achieve.



      So my question is how do I incorporate that into my application?



      PS. My assumption is that I need to somehow display that login script in a popup web browser page from my app, then somehow collect a login session ID from it after the user enters the email and password, and then use it for further requests to send the SMS. Any pointers will be appreciated...







      c# .net windows sms google-voice






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 4:23









      c00000fd

      7,7131174209




      7,7131174209



























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235973%2fhow-to-obtain-google-login-session-cookie-and-later-use-it-to-send-sms-via-googl%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235973%2fhow-to-obtain-google-login-session-cookie-and-later-use-it-to-send-sms-via-googl%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

          Syphilis

          Darth Vader #20