Comments (13)
Try the following which works for me
test_email <- mime(
To = "[email protected]",
From = "[email protected]",
Subject = "this is just a gmailr test")
test_email <- html_body(test_email, "Can <b>you</b> hear me now?")
create_draft(test_email)
from gmailr.
Thank you @jimhester for the feedback.
create_draft
returned the following error:
> create_draft(test_email)
Error in UseMethod("from") :
no applicable method for 'from' applied to an object of class "gmail_draft"
My code:
# From Jim Hester
test_email <- mime(
To = "[email protected]",
From = "[email protected]",
Subject = "this is just a gmailr test")
test_email <- html_body(test_email, "Can <b>you</b> hear me now?")
create_draft(test_email)
ret_val <- send_message(test_email)
What did I miss?
from gmailr.
Try installing the latest version from GitHub.
# install.packages("devtools")
install_github("jimhester/gmailr")
from gmailr.
OK -- progress! I was able to create a draft once successfully. However, i have not been able to send_message
successfully and now after one draft i am getting the error:
Error in loadNamespace(name) : there is no package called ‘crayon’
both when i send_message
and create_draft
I triied to install the package crayon but when i do i get another odd output from both send and create draft as follows:
create_draft(test_email)
Id: r-5335522915222148839
To:
From:
Date:
Subject:
> send_message(test_email)
Id: 153d3bae42b75989
To:
From:
Date:
Subject:
from gmailr.
Hi @jimhester
One other note. When I install from github and try to authenticate, it says it can't find OAuth2 in the browser.
So this line
gmail_auth("data-institute-email.json", scope = 'compose')
Fails. When I install from cran I'm able to authenticate with no problem.
Leah
from gmailr.
Try installing from GitHub again, I have fixed a few things which should make this work better for you.
You need to use the secret_file
parameter to read the secret from the json. Alternatively the github version packages a secret file so you can use that without needing to supply a file.
gmail_auth(secret_file = "data-institute-email.json", scope = 'compose')
I am currently getting a Bounce error when trying to send the email, but the message still seems to go through... Creating a draft with create_draft()
then sending that does work however, I am not sure what is going wrong with directly sending...
from gmailr.
Ok d5db6a7 now sends without Bouncing, so try updating again and let me know if it doesn't work.
from gmailr.
Thank you. Please tell me if am doing this wrong. I got an error on the install. So I uninstalled gmailr and made sure it was gone in my library dir on my mac. I then installed from github and got the following message / error (at the very bottom):
Downloading` GitHub repo jimhester/gmailr@master
from URL https://api.github.com/repos/jimhester/gmailr/zipball/master
Installing gmailr
Downloading GitHub repo gaborcsardi/argufy@173245a7e
from URL https://api.github.com/repos/gaborcsardi/argufy/zipball/173245a7e
Installing argufy
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file \
--no-environ --no-save --no-restore CMD INSTALL \
'/private/var/folders/x9/0p6djscn2890hpkvmlz4nx0nn42rsp/T/Rtmpatr7rD/devtools6021099596c/gaborcsardi-argufy-173245a' \
--library='/Library/Frameworks/R.framework/Versions/3.2/Resources/library' \
--install-tests
* installing *source* package ‘argufy’ ...
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (argufy)
Skipping 1 unavailable package: argufy
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file \
--no-environ --no-save --no-restore CMD INSTALL \
'/private/var/folders/x9/0p6djscn2890hpkvmlz4nx0nn42rsp/T/Rtmpatr7rD/devtools6028b6cef9/jimhester-gmailr-d5db6a7' \
--library='/Library/Frameworks/R.framework/Versions/3.2/Resources/library' \
--install-tests
* installing *source* package ‘gmailr’ ...
** R
** tests
** preparing package for lazy loading
** help
Error : /private/var/folders/x9/0p6djscn2890hpkvmlz4nx0nn42rsp/T/Rtmpatr7rD/devtools6028b6cef9/jimhester-gmailr-d5db6a7/man/id.gmail_messages.Rd: Sections \title, and \name must exist and be unique in Rd files
ERROR: installing Rd objects failed for package ‘gmailr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/gmailr’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/gmailr’
Error: Command failed (1)
from gmailr.
Sorry that was an inadvertent error, sorry for the confusion. It should now be fixed.
from gmailr.
Ok... it installed perfectly but i'm still getting the following error (it authenticates and then throws an error when i try to create draft or send_email.
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
Error: .onLoad failed in loadNamespace() for 'crayon', details:
call: get0(oNam, envir = ns)
error: lazy-load database '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/memoise/R/memoise.rdb' is corrupt
In addition: Warning message:
In get0(oNam, envir = ns) : internal error -3 in R_decompress1
> send_message(test_email)
Error: .onLoad failed in loadNamespace() for 'crayon', details:
call: get0(oNam, envir = ns)
error: lazy-load database '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/memoise/R/memoise.rdb' is corrupt
In addition: Warning messages:
1: In get0(oNam, envir = ns) : restarting interrupted promise evaluation
2: In get0(oNam, envir = ns) : internal error -3 in R_decompress1
the path there is where my packages are stored so is this error on my end?
Thank you!
from gmailr.
Something strange is going on. Does this happen if you start an entirely new session? You may want to try reinstalling the crayon package from CRAN as well.
from gmailr.
ok! Progress. Iyou are right - something was weird with my session. I restarted.
Now i'm not able to use gmail_auth after i install from github. i get the following information in the browser if this helps:
scope=https://www.googleapis.com/auth/gmail.compose
response_type=code
redirect_uri=http://localhost:1410
state=H8JTSXEbMZ
client_id=data-institute-email.json
However, if i install from cran. run gmail_auth AND then install from github, i can send an html email successfully! it does ask me to authenticate a few other items (create draft, etc) when i use create_draft but then it works.
Is there something there that is different in gmail_auth in the git version compared to the cran version?
Thank you so much for working through this with me!
from gmailr.
@jimhester is there any way we can send whole html file by placing the directory?
from gmailr.
Related Issues (20)
- display name not showing up HOT 1
- Getting Started Vignette Seems Outdated HOT 3
- Problem on R 4.2.1? HOT 8
- gm_auth_configure() and gm_send_message() work locally but not remotely on Cloud Build with same JSON file (or key and secret) specified HOT 7
- Unable to confirm Google credentials for `Gmailr` when running via Windows Task Scheduler HOT 8
- Update `gm_auth_configure()` to take `client` HOT 1
- Upkeep for gmailr
- `usethis::use_readme_rmd()`
- Update errors to rlang 1.0.0. Helpful guides:
- Add the web / pseudo-oob case to the OAuth client article
- Move lots of README content to articles
- Make it possible to pass `subject` to `gm_auth()`
- Update Get Started
- send another email in the same thread HOT 1
- Release gmailr 2.0.0 HOT 2
- Authentication expiring repetitively for non-interactive auth HOT 2
- Subject becomes garbled when it contains accented character and more than 55 characters HOT 2
- Are there any changes in gm_auth_configure() -> error: attempt to apply non-function HOT 4
- Upkeep for gmailr (2023)
- Update error for `gmailr_query()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gmailr.