2013-12-20 69 views
0

我想知道是否可以將網頁上的表格傳遞給電子郵件正文。我在想,如果這是可能的,如果有那麼點我在正確的方向將包含網頁表格的電子郵件發送到電子郵件正文

我的按鈕:

<input type="submit" value="SUBMIT EMAIL TO: GNOC" <a 

href="mailto:[email protected]"> 

表:

<table cellpadding="4" cellspacing="0" 

border="0" width="100%"> 
      <tr> 
       <td 

id="_invisibleIfEmpty" name="_invisibleIfEmpty" 

colspan="3" valign="top" width="100%"> 

<WebPartPages:WebPartZone runat="server" 

Title="loc:Header" ID="Header" 

FrameType="TitleBarOnly"/> </td> 
      </tr> 
      <tr> 
       <td 

id="_invisibleIfEmpty" name="_invisibleIfEmpty" 

rowspan="4" valign="top" height="100%"> 

<WebPartPages:WebPartZone runat="server" 

Title="loc:LeftColumn" ID="LeftColumn" 

FrameType="TitleBarOnly"/> </td> 
       <td 

id="_invisibleIfEmpty" name="_invisibleIfEmpty" 

valign="top" height="100%"> <WebPartPages:WebPartZone 

runat="server" Title="loc:Row1" ID="Row1" 

FrameType="TitleBarOnly" Orientation="Horizontal"/> 

</td> 
       <td 

id="_invisibleIfEmpty" name="_invisibleIfEmpty" 

rowspan="4" valign="top" height="100%"> 

<WebPartPages:WebPartZone runat="server" 

Title="loc:RightColumn" ID="RightColumn" 

FrameType="TitleBarOnly"/> </td> 
      </tr> 
      <tr> 
       <td 

id="_invisibleIfEmpty" name="_invisibleIfEmpty" 

valign="top" height="100%"> <WebPartPages:WebPartZone 

runat="server" Title="loc:Row2" ID="Row2" 

FrameType="TitleBarOnly" Orientation="Horizontal"/> 

</td> 
      </tr> 
      <tr> 
       <td 

id="_invisibleIfEmpty" name="_invisibleIfEmpty" 

valign="top" height="100%"> <WebPartPages:WebPartZone 

runat="server" Title="loc:Row3" ID="Row3" 

FrameType="TitleBarOnly" Orientation="Horizontal"/> 

</td> 
      </tr> 
      <tr> 
       <td 

id="_invisibleIfEmpty" name="_invisibleIfEmpty" 

valign="top" height="100%"> <WebPartPages:WebPartZone 

runat="server" Title="loc:Row4" ID="Row4" 

FrameType="TitleBarOnly" Orientation="Horizontal"/> 

</td> 
      </tr> 
      <tr> 
       <td 

    id="_invisibleIfEmpty" name="_invisibleIfEmpty" 

colspan="3" valign="top" width="100%"> 

<WebPartPages:WebPartZone runat="server" 

Title="loc:Footer" ID="Footer" 

FrameType="TitleBarOnly"/> </td> 
      </tr> 
      <script 

language="javascript">if(typeof 

(MSOLayout_MakeInvisibleIfEmpty) == "function") 

{MSOLayout_MakeInvisibleIfEmpty();}</script> 
    </table> 

目標:導入表從網絡表格到電子郵件正文

+1

不要以爲你可以。它將是一個字符串而不是HTML。 – putvande

+0

[MailTo與HTML正文]可能的重複(http://stackoverflow.com/questions/5620324/mailto-with-html-body) – putvande

+0

但我的Outlook屬性可以切換到HTML模式,所以我不明白爲什麼它不能採取這些表? – SlopTonio

回答

0

這是不可能的。

但是,爲什麼不使用ajax調用來發送表中的所有信息,就好像它是表單一樣?在單獨的PHP文件你打電話,使用PHP的郵件功能(http://php.net/manual/en/function.mail.php

例如:

<form type="POST"> 
<table> <!-- This is your table --> 
<tr> 
<td> 
Username 
</td> 
<td> 
<input type="text" name="username" value="whateveruserentered" /> 
</td> 
</tr> 
<table> 

所以在AJAX方法,你會通過發送用戶名。然後在你打電話給你的php頁面上,你會說

<table> 
<tr> 
<td> 
Username 
</td> 
<td> 
<?php echo $_POST['username']; ?> 
</td> 
</tr> 
<table> 

所以你正在重新創建表。

將所有這些放在郵件屬性的主體中,然後關閉它。就像在原始頁面上一樣,完全成熟的桌子。

爲了發送你想要的模板化信息?

相關問題