gmailr icon indicating copy to clipboard operation
gmailr copied to clipboard

Add an example setting the from field?

Open maelle opened this issue 5 years ago • 2 comments

In the vignette about sending emails, could there be an example setting the From field to a name and an address as in this community forum post?

I.e. e.g.

text_msg <- gm_mime() %>%
  gm_to("[email protected]") %>%
  gm_from("Gmailr Fan <[email protected]>") %>%
  gm_text_body("Gmailr is a very handy package!")

maelle avatar Feb 03 '20 15:02 maelle

Sounds like a good idea to me!

jimhester avatar Apr 03 '20 15:04 jimhester

Very related to #171

Yes, this sort of code results in a display name appearing if and only if the gm_from() address is actually the sending address (see gm_profile()):

text_msg <- gm_mime() %>%
  gm_to("[email protected]") %>%
  gm_from("Gmailr Fan <[email protected]>") %>%
  gm_text_body("hello!")

If you aren't actually auth'ed as [email protected] then the gm_from() information is basically ignored.

So this shows how to do this on the fly, whereas #171 is about configuring settings or just having a better default.

jennybc avatar May 03 '23 00:05 jennybc