Javascript 将数据从vue.js发布到本地主机上的phpmailer

Javascript 将数据从vue.js发布到本地主机上的phpmailer,javascript,php,node.js,vue.js,axios,Javascript,Php,Node.js,Vue.js,Axios,有没有办法从我的本地.vue文件向带有axios或fetch的本地phpmailer文件发出POST请求 以下是我提交脚本的实际立场: methods: { onSubmit(e) { e.preventDefault(); console.log(e.preventDefault()); axios .post('mail.php', querystring.stringify(this.form), { headers: { 'X-

有没有办法从我的本地
.vue
文件向带有
axios
fetch
的本地
phpmailer
文件发出POST请求

以下是我提交脚本的实际立场:

methods: {
onSubmit(e) {
  e.preventDefault();
  console.log(e.preventDefault());
  axios
      .post('mail.php', querystring.stringify(this.form), {
        headers: {
          'X-Requested-Width': 'XMLHttpRequest',
          'Content-type': 'application/x-www-form-urlencoded'
        }
      })
      .then( res => {
        res.send = true;
      })
      .catch( err => {
        console.log(err.response);
      })
  }
}
但如果我提交,我会得到以下错误:

POST http://localhost:8080/mail.php 404 (Not Found)
但该文件位于该服务器上的正确文件夹中


有人知道如何修复此错误吗?

在哪台服务器上运行phpmailer?phpmailer与我的vue应用程序在同一台服务器上运行它与cURL一起工作吗?因为对meso来说,这看起来不像是vue特有的问题,所以我尝试了curl.post函数,没有收到任何错误,但系统没有向我发送任何邮件。