charmbracelet / pop

Send emails from your terminal 📬
MIT License
2.28k stars 43 forks source link

[ERROR]: The gmail.com domain is not verified. #27

Closed ashishbinu closed 11 months ago

ashishbinu commented 11 months ago

Describe the bug Pop is not working with gmail. It is showing this error

 [ERROR]: The gmail.com domain is not verified. Please, add and verify your domain on https://resend.com/domains

To Reproduce Steps to reproduce the behavior:

  1. Install pop
  2. Setup env variables
    export RESEND_API_KEY="$(pass api/resend)"
    export POP_FROM="public.email@gmail.com"
    export POP_SMTP_HOST=smtp.gmail.com
    export POP_SMTP_PORT=587
    export POP_SMTP_USERNAME="public.email@gmail.com"
    export POP_SMTP_PASSWORD="password"
  3. Send mail using pop command.
  4. When pressing enter it shows the error

Expected behavior I believe it should send email without showing the error.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

ashishbinu commented 11 months ago

I also tried adding gmail.com as suggested in the error. But it shows can't add public domains error in the dashboard.

caarlos0 commented 11 months ago

Hey!

You don't need to set RESEND_API_KEY if you are using SMTP, so probably unexporting that env should fix the issue.

ashishbinu commented 11 months ago

Hey!

You don't need to set RESEND_API_KEY if you are using SMTP, so probably unexporting that env should fix the issue.

image

It says the api key is required

caarlos0 commented 11 months ago

@ashishbinu if you have the POP_SMTP_* environments set, it should not give you that error:

❯ env | rg RESEND

❯ env | rg SMTP
POP_SMTP_HOST=smtp.gmail.com
POP_SMTP_USERNAME=public.email@gmail.com
POP_SMTP_PORT=587
POP_SMTP_PASSWORD=password

❯ pop

 From public.email@gmail.com
 To you@example.com
 Subject Hello!

 ┃ # Email
 ┃
 ┃
 ┃
 ┃
 ┃

 Attachments
 No attachments.

   Send

 tab next • ctrl+c quit
ashishbinu commented 11 months ago

@caarlos0 It's all set but it still shows the resend api key env variable required.

ashishbinu commented 11 months ago

I just updated the pop to version 0.2.0 . the resend api is required is gone. But still some oauth error is there. Let me see if i can fix that.

ashishbinu commented 11 months ago

@caarlos0 It's working now. As I had 2 factor authentication enabled had to create app password from google and replace the POP_SMTP_PASSWORD with that app password.