我正在尝试仅使用HTML自动填充电子邮件表单

时间:2017-08-07 04:12:38

标签: html enctype

除了身体部位外,一切看起来都很好。如果用户输入“随身携带啤酒”,则电子邮件的正文将显示“Grab + a + beer + with + you”。如何让身体只是一个空间而不是+。我也对我应该使用的东西感到困惑,有些地方说它应该是一个POST,但GET有效,POST则没有。无论如何,这是我的代码。

<form enctype="text/plain" method="GET" action="mailto:{rudyg@hotmail.com}?subject=Subject&body=Body">

    <div class="form-group">
    <label for="exampleSelect1">What is this in regards to?</label>
        <select class="form-control" id="exampleSelect1" name="subject" value="Subject">
            <option value="Job&nbsp;opportunity">Job opportunity</option>
            <option value="Question&nbsp;about&nbsp;myself&nbsp;or&nbsp;my&nbsp;code">Question about myself or my code</option>
            <option value="General&nbsp;Question">General Question</option>
            <option value="">No subject</option>
        </select>
    </div>

    <div class="form-group">
        <label for="exampleTextarea">What would you like to say?</label>
            <textarea class="form-control" id="exampleTextarea" name="body" value="Body" rows="4" placeholder="I'd like to speak with you about an exciting job opportunity."></textarea> 
    </div>

    <button type="submit" class="btn btn-primary" name="submit" value="Submit">Submit</button>

</form>

很抱歉,我的意思是说我也试过了enctype =“text / plain”,但它仍然给了我电子邮件的正文。

1 个答案:

答案 0 :(得分:3)

将表单标记中的enctype属性更改为text / plain,如:

enctype="text/plain"