猿问

用C# .net写一个发送邮箱的代码

我有一个页面里面有table  格式是固定的 由用户填写,填写的内容不定。用户填写好了后点击下面的提交。我想把页面用户填写的table发送到固定邮箱。收件人必须看到用户填写的内容,格式也是table的.(图片也可以,自要收件人能看到就行。!但必须要格式)
森栏
浏览 456回答 17
17回答

慕田峪4524236

主要是body里要那么写,我现在想到的就是根据前台传来的数据拼接!但太麻烦了。有简单点的方法吗?

慕盖茨4494581

你这和我的有点想进,你这太复杂了。我就要1对1的发送邮件。注:发送前台页面的数据和格式。接受邮件的人看到的和页面看到的是一样的。(表格或图都行)

杨魅力

@温柔的意外: 你直接把html发过去不就行了

长风秋雁

@稳稳的河: 你是说发送网址?要的结果是收件人要看到数据就想页面一样的效果(比如:页面是表格,那么他看到的也是表格)

Helenr

@温柔的意外: 不是网站,你可以把页面COPY出来(js直接有copy的方法),作为body发送,你看我上面的template其实都是拼接html

守候你守候我

@温柔的意外: 我给个例子你把,把一个div克隆下来,那些不要你就remove(你把整个页面克隆出来) var html = $('.inner_main_div').clone(); html.find('select[name="formatId"]').after($('#order_form select[name="formatId"] option:selected').text()).remove(); html.find('input[name="PoNo"]').after($('#order_form input[name="PoNo"]').val()).remove(); html.find('input[name="VendorPo"]').after($('#order_form input[name="VendorPo"]').val()).remove(); html.find('select[name="printShopId"]').after($('#order_form select[name="printShopId"] option:selected').text()).remove(); html.find('select[name="overage"]').after($('#order_form select[name="overage"] option:selected').text()).remove(); html.find('.title span').remove(); html.find('input:button').remove(); html.find('.addressUl').css('display', 'block'); html.find('.addressDropdown').remove(); html.find('p:first').remove(); html.find('form').attr('id', ''); html.find('.star_mark').remove(); //html.find('form span').remove(); html.find('div.address-title').remove(); html.find('div.search_action').remove(); html.find('.top_content').css({ margin: "10px 0px 0px 0px", width: "74%" }); html.find('.top_title').css("text-align", "right"); html.find('.shipto_div').css("margin-right", "50px"); html.find('input[type=text]').each(function() { if ($(this).attr('type') != 'hidden') { $(this).after($(this).val()).remove(); } });

RISEBY

@温柔的意外: 还有你也可以获取数据,自己拼接你想要的html,其实都是前端的东西

慕森卡

@稳稳的河: 我知道拼接HTML邮件,还有没有跟简单点的方法。

守着一只汪

@温柔的意外: 上面不是说了复制,挺简单的

尚方宝剑之说

@稳稳的河: JackWang-CUMT写了我上面的简化版本,直接去html,你不愿意去自己试试,给个建议自己多去试试,直接要源码没什么用
随时随地看视频慕课网APP
我要回答