Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email Header issue #6895

Open
AdvithShetty opened this issue Jun 23, 2024 · 3 comments
Open

Email Header issue #6895

AdvithShetty opened this issue Jun 23, 2024 · 3 comments
Labels
status: needs-triage Possible bug which hasn't been reproduced yet v3

Comments

@AdvithShetty
Copy link

Link to reproduction

No response

Payload Version

v3 beta.45

Node Version

v20.15.01

Next.js Version

14.2

Describe the Bug

I have tried using SMTP settings as displayed in the docs, also tried using the payload/email-nodemailer plugin and also sendmailer-sendgrid plugin

But even with defaultfromaddress provided the email sent do not have from address and the emails get rejected immediately.

I have even tried mailgun but that didn't work too but i got the error below:

`

  5.7.1 [159.135.228.5] Gmail has detected that this message is not RFC 5322 5.7.1 compliant: 5.7.1 'From' header is missing. 5.7.1 To reduce the amount of spam sent to Gmail, this message has been 5.7.1 blocked. For more information, go to 5.7.1 https://support.google.com/mail/?p=RfcMessageNonCompliant and review 5.7.1 RFC 5322 specifications. 3f1490d57ef6-e02e65ef0f5si2637960276.635 - gsmtp  
`

Reproduction Steps

Done the setup according to the payload docs

Adapters and Plugins

sendmailer-sendgrid, email-nodemailer

@AdvithShetty AdvithShetty added status: needs-triage Possible bug which hasn't been reproduced yet v3 labels Jun 23, 2024
@qamarq
Copy link

qamarq commented Jun 23, 2024

+1

bug desc:
its making from header like:
name <name>
instead of correctone:
name <email>

@denolfe
Copy link
Member

denolfe commented Jun 25, 2024

@AdvithShetty Thanks for the report. Can you provide your email config?

@AdvithShetty
Copy link
Author

I was using this previously

 email: nodemailerAdapter({
    // There is an issue with payload where FromName is being used for Name and Email
    // and therefore having to resort to using email in FromName and From Address
    defaultFromAddress:
      process.env.EMAIL_FROM_NAME ,
    defaultFromName:
      process.env.EMAIL_FROM_ADDRESS,
    transport: nodemailer.createTransport({
      // @ts-ignore
      host: process.env.SMTP_HOST,
      port: process.env.SMTP_PORT,
      // secure: true,
      auth: {
        user: process.env.SMTP_USER,
        pass:
          process.env.SMTP_PASS,
      },
    }),
  }),

now as a work around I have set both name and email as email

 email: nodemailerAdapter({
    // There is an issue with payload where FromName is being used for Name and Email
    // and therefore having to resort to using email in FromName and From Address
    defaultFromAddress:
      process.env.EMAIL_FROM_ADDRESS ,
    defaultFromName:
      process.env.EMAIL_FROM_ADDRESS,
    transport: nodemailer.createTransport({
      // @ts-ignore
      host: process.env.SMTP_HOST,
      port: process.env.SMTP_PORT,
      // secure: true,
      auth: {
        user: process.env.SMTP_USER,
        pass:
          process.env.SMTP_PASS,
      },
    }),
  }),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet v3
Projects
None yet
Development

No branches or pull requests

3 participants