首页 > 解决方案 > 电子邮件正文的每个空格之间有 %20

问题描述

我从sololearn.com 编码的ide 的链接是https://code.sololearn.com/Wg70wiK3e0h3/#html但我永远无法真正发送电子邮件,所以我使用记事本和发送的正文消息由 %20 填充,就好像它是一个链接一样。下面的“代码”是我构建正文消息并发送电子邮件的功能。如果你在sololearn中查看我的完整代码,它在2000ish行,它在3000ish行被调用。顺便说一句,其余代码运行良好。

这个函数有更多,但它太大了,不能放在这里,但基本上我将数据添加到消息变量中,就像性别一样,但多次使用多个变量,但都使用相同的语法

     function sendEmail(){

            message = "Hi this is just a way for you to have all the main data summed up saved in your email inbox. \n \n";

            message += "Gender: ";

            message += genderreturn;

            message += " \n";

            url = "mailto:" + emailaddrreturn + "?subject=" + subject + "&body=" + message;

            location.href = url; //(might want to use window.location or something else here)
}

标签: javascriptemail

解决方案


推荐阅读