Skip to content

New Gmail security won't accept application password #348

@bac3917

Description

@bac3917

Even with an app password a simple email won't send.

Use a Gmail App Password here (not your normal password)

smtp <- server(
host = "smtp.gmail.com",
port = 587,
username = "me@gmail.com",
password = Sys.getenv("wert qqqq wwww azzz")
)

msg <- envelope() |>
from("me@gmail.com") |>
to("joejoe@nuts.org") |>
subject("Test from emayili") |>
text("Hello from R (sent without Java and without blastula).")

smtp(msg, verbose = TRUE)

throws this error:
535-5.7.8 Username and Password not accepted. For more information, go to
535 5.7.8 https://support.google.com/mail/?p=BadCredentials 6a1803df08f44-8953c03d5adsm20575956d6.32 - gsmtp
closing connection #12
Hostname smtp.gmail.com was found in DNS cache

My deets:

platform x86_64-w64-mingw32
arch x86_64
os mingw32
crt ucrt
system x86_64, mingw32
status
major 4
minor 5.1
year 2025
month 06
day 13
svn rev 88306
language R
version.string R version 4.5.1 (2025-06-13 ucrt)
nickname Great Square Root

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions