我正在尝试编写一个已创建正文的mailto表单。目前我保持简单,并试图将电子邮件,地址和姓名放入要发送的电子邮件正文中。当我这样做时,它返回上述错误。这是代码。 HTML:
<form method='post' enctype="text/plain">
<b>Name:</b><br>
<input type="text" name="personsName" id="personsName"><br>
<b>E-mail:</b><br>
<input type="text" name="mail" id ="mail"><br>
<b>Address:</b><br>
<input type="text" name="address" id ="address"><br>
<input type="submit" value="Send" id="send">
</form>
这是相关的JavaScript:
$(function(){ EGf20a6658.Init(); });
var EGf20a6658 = {
Init: function() {
if (typeof(OEConfEGf20a6658) === undefined) return;
var allElements = OEConfEGf20a6658;
for(var ID in allElements) {
var $el = $('#'+ID); // The element's main <div> tag
var properties = allElements[ID]; // element's available properties for JS
this.InitElement(ID, $el, properties);
}
},
InitElement: function(ID, $el, properties) {
var name = $('#personsName').val();
var mail = $('#mail').val();
var address = $('#address').val();
var message = "Hey " + " How are you? You still at " + " with the email " + "?";
var mailtolink = 'mailto:me@domain.com?subject=Regret Permission Form&body=' + encodeURIComponent(message);
$( '#send' ).on( 'click', function(event) {
$(this).attr('href', mailtolink);
});
}
};
正如你所看到的那样,它很简单,但我无法弄明白。但我知道错误总是返回name的值。任何建议或帮助都会很棒。谢谢你提前。
编辑:这是完整的错误代码:
500 - Unexpected new line: k [CRLF].
System.InvalidOperationException: Unexpected new line: k
[CRLF].
at HttpServer.Tools.StringReader.ReadToEnd(String delimiters)
at HttpServer.Tools.UrlParser.Parse2(ITextReader reader, Boolean urlDecode)
at HttpServer.Tools.UrlParser.Parse2(String queryString, Boolean urlDecode)
at HttpServer.RequestEventArgs.FixPostData(IRequest request)
at HttpServer.RequestEventArgs..ctor(IHttpContext context, IRequest request, IResponse response)
at HttpServer.HttpContext.OnRequest(Object sender, FactoryRequestEventArgs e)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at HttpServer.Messages.MessageFactoryContext.OnMessageComplete(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at HttpServer.Messages.Parser.HttpParser.OnComplete()
at HttpServer.Messages.Parser.HttpParser.GetBody()
at HttpServer.Messages.Parser.HttpParser.Parse(Byte[] buffer, Int32 offset, Int32 count)
at HttpServer.HttpContext.ParseBuffer(Int32 bytesLeft)
at HttpServer.HttpContext.OnReceive(IAsyncResult ar)