简体   繁体   中英

Contact me form doesn't want to work - using smtpjs.com

I'm new to smtp and could use some help. My code is below, I'm using https://smtpjs.com as a free alternative to help send requests to my smtp server.

  Email.send({
    SecureToken: "token",
    Password: "password",
    To: "connorwitmer34@gmail.com",
    From: fields.email,
    Subject: `${fields.subject} - ${fields.phone}`,
    Body: fields.message,
  }).then((message) => alert(message)); 

```

It can be assumed that the fields object is working fine.

The error I am getting when using any email besides my own is Mailbox name not allowed. The server response was: Envelope FROM 'test@gmail.com' email address not allowed. Mailbox name not allowed. The server response was: Envelope FROM 'test@gmail.com' email address not allowed. Please note that this is the "sender" address, not the address I want it sent to. It seems to work fine when I use my personal email.

Could this be some sort of weird safeguard against spam? If so, how do I combat this?

Problem has been fixed. I remedied my "non-verified email" issue but setting both the to AND from fields to my email, and then just adding the users email to the message body. Apparently several months back were abusing a feature, and Google's security policy was updated to prevent spam/hackers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM