使用HTML代码发送邮件 [英] Send Mail Using HTML Code

查看:165
本文介绍了使用HTML代码发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的



我创建了一个HTML页面。我使用HTML代码发送邮件。

解决方案

这是我最近使用的一个表单,它允许下拉预选地址,它可能会有用。



 <   pre     lang   =  xml >  <  表格    action   =  ../    enctype   =  text / plain >  
< p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px >
< 输入 名称 = customername size = 60

< span class =code-attribute> style = background-color:#FFFFCC; text-align:left; type = text

value = 名称 tabindex = 1 / >
< 输入 名称 = customernumber size = 60

< span class =code-attribute> 样式 = background-color:#FFFFCC; text-align:left;宽度:202px; margin-left:42px;

type = text value = 电话号码 tabindex = 2 / >
< 输入 name = space size = 0 样式 = width:0px; value = %0A tabindex = 0 / >
< / p >
< < span class =code-leadattribute> p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px;身高:12px;宽度:655px; > < / p >
< p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px > 请使用我们的联系表格进行查询。< / p >
< p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px > < / p >
< p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px > 查询类型?< / p >
< p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px >
< 选择 id = SelectContactType name = sendEmailTo onchange = setAction

tabindex = 3 >
< < span class =code-leadattribute>选项 value = mailto:sales@fosbern.co.uk?subject = HomeQuery& body = > 销售< / option > ;
< 选项 value = mailto:colin@fosbern.co.uk?subject = HomeQuery& body = > 承包商< / option > ;
< 选项 value = mailto:pat @ fosbern .co.uk?subject = HomeQuery& body = > 技术< < span class =code-leadattribute> / option >
< 选项 value = mailto:enq uiries@fosbern.co.uk?subject = HomeQuery& body = > 其他< / option >
< / select >
< / p >
< p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px > < / p >
< p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px > 您的问题... < / p >
< < span class =code-leadattribute> p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px;高度:62px; >
< textarea cols = 10 = 3 id = TextArea1 名称 = textarea tabindex = < span class =code-keyword> 4

style = 溢出:可见; width:507px; > < / textarea >
< / p >
< p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px;高度:9px; > < / p >
< p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px;高度:9px; > < / p >
< p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px;高度:9px; > < / p >
< p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px > 最后,您的电子邮件地址...... < / p >
< p style = MARGIN-TOP:0px; MARGIN-BOTTOM:0px >
< 输入 名称 = customeremailaddress size = 60

样式 = background-color:# FFFFCC type = text tabindex = 5 / >
< input

< span class =code-attribute> type = 按钮

value = 提交

< span class =code-attribute> onclick = location.href = this.form.sendEmailTo.options [sendEmailTo.selectedIndex] .value + this.form.customername.value + this.form.space.value + this.form.customernumber.value + this.form.space.value + this.form.textarea.value + this.form.space.value + this.form.customeremailaddress.value

tabindex = 5 / >
< / p >
< p style = text-align:center >
按提交按钮,我们会尽快与您联系并提供详细信息,价格

< / p >
< / form >





如果你想使用html发送电子邮件,你需要使用mailto:标签。

应该在你的机器上配置一些电子邮件客户端。



请参见此处 [ ^ ]。


您好,你可以看到这个链接( http://answers.oreilly.com/主题/ 2349 - 创建 - 一个接触外形ASPNET -c / [ ^ ])解释了如何开发基于ASP.NET(C#)的联系表单。在每种情况下,除了语言(Javascript,ASP.NET等)之外,您还使用HTML。



最好的问候
$ b $bÁngelManuel

Dear

I have created one HTML Page. I send the mail using HTML Code.

解决方案

Here is a form I used recently, it allows dropdowns to preselected addresses, it may prove helpful.

<pre lang="xml"><form action="../" enctype="text/plain">
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
        <input name="customername" size="60"

            style="background-color: #FFFFCC; text-align: left;" type="text"

            value="Name" tabindex="1"/>
        <input name="customernumber" size="60"

            style="background-color: #FFFFCC; text-align: left; width: 202px; margin-left: 42px;"

            type="text" value="Tel No." tabindex="2" />
        <input name="space" size="0" style="width:0px;" value="%0A" tabindex="0" />
    </p>
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 12px; width: 655px;"> </p>
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Please use our contact form to make any enquiries.</p>
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p>
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Type of enquiry?</p>
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
        <select id="SelectContactType" name="sendEmailTo" onchange="setAction"

            tabindex="3">
            <option value="mailto:sales@fosbern.co.uk?subject=HomeQuery&body=">Sales</option>
            <option value="mailto:colin@fosbern.co.uk?subject=HomeQuery&body=">Contractor</option>
            <option value="mailto:pat@fosbern.co.uk?subject=HomeQuery&body=">Technical</option>
            <option value="mailto:enquiries@fosbern.co.uk?subject=HomeQuery&body=">Other</option>
        </select>
    </p>
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p>
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Your Question...</p>
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 62px;">
        <textarea cols="10" rows="3" id="TextArea1" name="textarea" tabindex="4"

            style="overflow: visible; width: 507px;"></textarea>
    </p>
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 9px;"> </p>
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 9px;"> </p>
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 9px;"> </p>
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Finally, Your Email Address...</p>
    <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
        <input name="customeremailaddress" size="60"

            style="background-color: #FFFFCC" type="text" tabindex="5" />
        <input

            type="button"

            value="Submit"

            onclick="location.href=this.form.sendEmailTo.options[sendEmailTo.selectedIndex].value + this.form.customername.value + this.form.space.value + this.form.customernumber.value + this.form.space.value + this.form.textarea.value + this.form.space.value + this.form.customeremailaddress.value"

            tabindex="5"/>
    </p>
    <p style="text-align:center">
        Press the Submit Button and we will contact you shortly with details, prices
        etc
    </p>
    </form>




If you want to send email using html, you need to use the mailto: tag.
Some email client should be configured on your machine.

See here[^].


Hello, you can see this link (http://answers.oreilly.com/topic/2349-creating-a-contact-form-aspnet-c/[^]) which explains how to develop a contact form based in ASP.NET (C#). In every cases you use HTML besides a language (Javascript, ASP.NET, etc.).

Best regards
Ángel Manuel


这篇关于使用HTML代码发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆