Git Product home page Git Product logo

Comments (3)

jennybc avatar jennybc commented on June 27, 2024

OK I re-installed but get much the same result.

suppressPackageStartupMessages(library(gmailr))
suppressPackageStartupMessages(library(dplyr))

text_msg <- mime() %>%
  to("[email protected]") %>%
  from("[email protected]") %>%
  text_body("default credentials, to and from [email protected]")

ret <- text_msg %>%
  send_message()
#> Error in the$last_response <<- content(req, "parsed"): cannot change value of locked binding for 'the'
#> Error in gmailr_query(POST, location, user_id, class, ...): cannot change value of locked binding for '.last_response'

## try the example from send_message()
send_message(mime(from="[email protected]", to="[email protected]",
                  subject="hello", "how are you doing?"))
#> Error in the$last_response <<- content(req, "parsed"): cannot change value of locked binding for 'the'
#> Error in gmailr_query(POST, location, user_id, class, ...): cannot change value of locked binding for '.last_response'

devtools::session_info("gmailr")
#> Session info --------------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.2.2 (2015-08-14)
#>  system   x86_64, darwin13.4.0        
#>  ui       RStudio (0.99.747)          
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  tz       America/Vancouver           
#>  date     2015-11-02
#> Packages ------------------------------------------------------------------
#>  package   * version    date       source                             
#>  argufy      1.0.0      2015-11-02 Github (gaborcsardi/argufy@f7cfeef)
#>  base64enc   0.1-3      2015-07-28 CRAN (R 3.2.0)                     
#>  curl        0.9.3      2015-08-25 CRAN (R 3.2.0)                     
#>  digest      0.6.8      2014-12-31 CRAN (R 3.2.0)                     
#>  gmailr    * 0.6.0      2015-11-02 Github (jimhester/gmailr@dcec99a)  
#>  httr        1.0.0      2015-06-25 CRAN (R 3.2.0)                     
#>  jsonlite    0.9.17     2015-09-06 CRAN (R 3.2.0)                     
#>  magrittr    1.5        2014-11-22 CRAN (R 3.2.0)                     
#>  mime        0.4        2015-09-03 CRAN (R 3.2.0)                     
#>  R6          2.1.1      2015-08-19 CRAN (R 3.2.0)                     
#>  stringi     1.0-1      2015-10-22 CRAN (R 3.2.0)                     
#>  stringr     1.0.0.9000 2015-10-27 Github (hadley/stringr@3813041)

from gmailr.

jimhester avatar jimhester commented on June 27, 2024

Should be fixed now, I was using the wrong assignment operator.

from gmailr.

jennybc avatar jennybc commented on June 27, 2024

Progress but still no joy. Sorry about all this but I'd really like to use the dev version instead of CRAN!

I think the first error is because the scope defaults to "read_only" even though I'm asking to send a message. But then, even once I've authorized the "compose" scope, it seems we're back to that 400 bad request from a while ago?

suppressPackageStartupMessages(library(gmailr))
suppressPackageStartupMessages(library(dplyr))

send_message(mime(from="[email protected]", to="[email protected]",
                  subject="hello", "how are you doing?"))
#> Use a local file to cache OAuth access credentials between R sessions?
#> 1: Yes
#> 2: No
#> 
#> Selection: 1
#> Waiting for authentication in browser...
#> Press Esc/Ctrl + C to abort
#> Authentication complete.
#> Error in gmailr_query(POST, location, user_id, class, ...) : 
#>   client error: (403) Forbidden

gmail_auth(scope = "compose")
#> Waiting for authentication in browser...
#> Press Esc/Ctrl + C to abort
#> Authentication complete.

send_message(mime(from="[email protected]", to="[email protected]",
                  subject="hello", "how are you doing?"))
#> Error in gmailr_query(POST, location, user_id, class, ...): client error: (400) Bad Request

text_msg <- mime() %>%
  to("[email protected]") %>%
  from("[email protected]") %>%
  text_body("default credentials, to and from [email protected]")

ret <- text_msg %>%
  send_message()
#> Error in gmailr_query(POST, location, user_id, class, ...): client error: (400) Bad Request

devtools::session_info("gmailr")
#> Session info --------------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.2.2 (2015-08-14)
#>  system   x86_64, darwin13.4.0        
#>  ui       RStudio (0.99.747)          
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  tz       America/Vancouver           
#>  date     2015-11-02
#> Packages ------------------------------------------------------------------
#>  package   * version    date       source                             
#>  argufy      1.0.0      2015-11-02 Github (gaborcsardi/argufy@f7cfeef)
#>  base64enc   0.1-3      2015-07-28 CRAN (R 3.2.0)                     
#>  curl        0.9.3      2015-08-25 CRAN (R 3.2.0)                     
#>  digest      0.6.8      2014-12-31 CRAN (R 3.2.0)                     
#>  gmailr    * 0.6.0      2015-11-02 Github (jimhester/gmailr@c834010)  
#>  httr        1.0.0      2015-06-25 CRAN (R 3.2.0)                     
#>  jsonlite    0.9.17     2015-09-06 CRAN (R 3.2.0)                     
#>  magrittr    1.5        2014-11-22 CRAN (R 3.2.0)                     
#>  mime        0.4        2015-09-03 CRAN (R 3.2.0)                     
#>  R6          2.1.1      2015-08-19 CRAN (R 3.2.0)                     
#>  stringi     1.0-1      2015-10-22 CRAN (R 3.2.0)                     
#>  stringr     1.0.0.9000 2015-10-27 Github (hadley/stringr@3813041)

I sent my most recent batch of email last night with the CRAN version, so I can give this a rest for another week or too and come back 😬.

from gmailr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.