简体   繁体   English

联系我表格不想工作 - 使用 smtpjs.com

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

I'm new to smtp and could use some help.我是 smtp 的新手,需要一些帮助。 My code is below, I'm using https://smtpjs.com as a free alternative to help send requests to my smtp server.我的代码如下,我使用https://smtpjs.com作为免费的替代方法,以帮助将请求发送到我的 smtp 服务器。

  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.可以假设字段 object 工作正常。

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.使用除我自己之外的任何 email 时出现的错误是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.当我使用我的个人 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.我纠正了我的“未验证电子邮件”问题,但将 to AND from 字段设置为我的 email,然后将用户 email 添加到消息正文中。 Apparently several months back were abusing a feature, and Google's security policy was updated to prevent spam/hackers.显然几个月前滥用了一项功能,谷歌的安全政策已更新以防止垃圾邮件/黑客。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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