简体   繁体   English

Nuxt-mail 适用于本地但不适用于在线托管

[英]Nuxt-mail works in local but not in online hosting

I configured Nuxt-mail to use an external mail server (from the hosting provider) like this:我将 Nuxt-mail 配置为使用外部邮件服务器(来自托管服务提供商),如下所示:

Nust 邮件配置

I send the email like the following (test both with Axios and not):我发送如下电子邮件(使用 Axios 测试和不测试):

电子邮件发送

Everything works fine when I try it from my computer (localhost) as you can see here:当我从我的计算机(本地主机)尝试时一切正常,如您在此处看到的:

本地主机工作

But it fails when I try from the online website:但是当我从在线网站尝试时它失败了:

在线网站失败

The Nuxt app is up as static website, I don't know if it makes a difference. Nuxt 应用程序作为静态网站启动,我不知道它是否有所作为。 Do you have any idea how to solve this?你知道如何解决这个问题吗?

Thanks a lot.非常感谢。

I recommend doing a quick search .我建议进行快速搜索

You'll notice what you're trying to achieve (static website) is not feasible.您会注意到您想要实现的目标(静态网站)是不可行的。 You will indeed need a running node.js server.您确实需要一个正在运行的 node.js 服务器。
PS: websites like Netlify and Vercel do not allow for such thing. PS:像 Netlify 和 Vercel 这样的网站不允许这样的事情。

It works locally because you have a webpack dev server running when using your project locally.它在本地工作,因为在本地使用项目时,您有一个 webpack 开发服务器正在运行。

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

相关问题 使用 nuxt-mail 在 Nuxt.js 中发送邮件 - Sending mail in Nuxt.js with nuxt-mail Javascript函数可在本地服务器上运行,但不能在线运行 - Javascript Function Works on Local Server but not Online Ajax请求可在本地服务器上使用,但不能在线使用 - Ajax request works on local server but not online Nuxt ^2.0.0 和 Firebase 托管 - Nuxt ^2.0.0 and Firebase Hosting 搜索邮政编码在线但不能离线(来自本地数据库) - searching zipcode works online but not offline (from local database) Javascript滚动器可在本地服务器上运行,但不能在线运行(jsScroller.js) - Javascript scroller works on local server but not online (jsScroller.js) 图像无法在线加载,但当我离线(本地)尝试时可以正常工作,这是为什么? - Images not loading online but works when I try it offline (local), why is this? SSG 如何在 Nuxt 中工作? - How SSG works in Nuxt? 我想创建本地天气应用,它可以在本地服务器上完美运行,但不能在线运行 - I want to create local weather App it works perfectly on local server but does not work online Nuxt页面过渡可在本地工作,但不能在Firebase托管上工作 - Nuxt page transitions work locally, but not on firebase hosting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM