不知道我什么时候写的了,很久了已经。这是入门级php代码。。
看效果图。只需要拷贝右边的代码到邮件最后面,或者在邮件客户端设置签名代码。粘贴进去就好。
代码如下。测试地址:http://shanmao.me/f/emailsignature.php
下载地址:emailsignature
[code lang=”html”]
Email signature generator</pre>
<h2>Email signature generator</h2>
<pre>
<!–?php if($_POST){ ?–></pre>
<hr />
<div class="show"><!–?php if($_POST[‘lang’]==1){ ?–>
<div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;"><a href="http://www.mechanist.co"><img src="http://www.mechanist.co/images/Pictures/Signature/mechanist%20signature%20128×128.jpg" alt="Mechanist Games" width="128" height="128" border="0" /></a>
<strong></strong>
<em></em><!–?php if($_POST[‘enname4’]!=""){ ?–>
<span style="color: #990000;">Tel: +86-592-<!–?php echo $_POST[‘enname4’]; ?–></span><!–?php }?–>
<span style="color: #990000;">Mobile: +86-<!–?php echo $_POST[‘enname5’]; ?–></span>
<span style="color: #990000;">Email: <!–?php echo $_POST[‘enname6’]; ?–><!–?php if($_POST[‘enname7’]!=""){ ?–>
QQ: <!–?php echo $_POST[‘enname7’]; }?–><!–?php if($_POST[‘enname8’]!=""){ ?–>
Skype: <!–?php echo $_POST[‘enname8’]; } ?–>
<a href="http://www.cityofsteam.com">www.cityofsteam.com</a>
<a href="http://www.mechanist.co">www.mechanist.co</a>
<!–?php if(@$_POST[‘address’]==1){ ?–>
Address: 0304 Lot, 11th F, Haiyi Building A
No.666 Xiahe Road
Xiamen, Fujian, China
<!–?php }?–>
</span>
<div></div>
</div>
<!–?php }else{?–>
<div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;"><a href="http://www.mechanist.co"><img src="http://www.mechanist.co/images/Pictures/Signature/mechanist%20signature%20128×128.jpg" alt="Mechanist Games" width="128" height="128" border="0" /></a>
<strong></strong>
<em></em><!–?php if($_POST[‘enname4’]!=""){ ?–>
<span style="color: #990000;">电话: +86-592-<!–?php echo $_POST[‘enname4’]; ?–></span><!–?php }?–>
<span style="color: #990000;">手机: +86-<!–?php echo $_POST[‘enname5’]; ?–></span>
<span style="color: #990000;">邮箱: <!–?php echo $_POST[‘enname6’]; ?–><!–?php if($_POST[‘enname7’]!=""){ ?–>
QQ: <!–?php echo $_POST[‘enname7’]; }?–><!–?php if($_POST[‘enname8’]!=""){ ?–>
Skype: <!–?php echo $_POST[‘enname8’]; } ?–>
<a href="http://www.cityofsteam.com">www.cityofsteam.com</a>
<a href="http://www.mechanist.co">www.mechanist.co</a>
</span><span style="color: #990000;">
<!–?php if(@$_POST[‘address’]==1){ ?–>
地址: 厦门市思明区厦禾路666号海翼大厦A座11层
<!–?php }?–>
</span>
<div></div>
</div>
<!–?php }?–></div>
<pre>
<textarea onclick="Onclicklink()"></textarea></pre>
<div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;"><a href="http://www.mechanist.co"><img src="http://www.mechanist.co/images/Pictures/Signature/mechanist%20signature%20128×128.jpg" alt="Mechanist Games" width="128" height="128" border="0" /></a>
<strong></strong>
<em></em><!–?php if($_POST[‘enname4’]!=""){ ?–>
<span style="color: #990000;">Tel: +86-592-<!–?php echo $_POST[‘enname4’]; ?–></span><!–?php }?–>
<span style="color: #990000;">Mobile: +86-<!–?php echo $_POST[‘enname5’]; ?–></span>
<span style="color: #990000;">Email: <!–?php echo $_POST[‘enname6’]; ?–><!–?php if($_POST[‘enname7’]!=""){ ?–>
QQ: <!–?php echo $_POST[‘enname7’]; }?–><!–?php if($_POST[‘enname8’]!=""){ ?–>
Skype: <!–?php echo $_POST[‘enname8’]; } ?–>
<a href="http://www.cityofsteam.com">www.cityofsteam.com</a>
<a href="http://www.mechanist.co">www.mechanist.co</a>
<!–?php if(@$_POST[‘address’]==1){ ?–>
Address: 0304 Lot, 11th F, Haiyi Building A
No.666 Xiahe Road
Xiamen, Fujian, China
<!–?php }?–>
</span>
<div></div>
</div>
<pre>
<textarea onclick="Onclicklink()"></textarea></pre>
<div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;"><a href="http://www.mechanist.co"><img src="http://www.mechanist.co/images/Pictures/Signature/mechanist%20signature%20128×128.jpg" alt="Mechanist Games" width="128" height="128" border="0" /></a>
<strong></strong>
<em></em><!–?php if($_POST[‘enname4’]!=""){ ?–>
<span style="color: #990000;">电话: +86-592-<!–?php echo $_POST[‘enname4’]; ?–></span><!–?php }?–>
<span style="color: #990000;">手机: +86-<!–?php echo $_POST[‘enname5’]; ?–></span>
<span style="color: #990000;">邮箱: <!–?php echo $_POST[‘enname6’]; ?–><!–?php if($_POST[‘enname7’]!=""){ ?–>
QQ: <!–?php echo $_POST[‘enname7’]; }?–><!–?php if($_POST[‘enname8’]!=""){ ?–>
Skype: <!–?php echo $_POST[‘enname8’]; } ?–>
<a href="http://www.cityofsteam.com">www.cityofsteam.com</a>
<a href="http://www.mechanist.co">www.mechanist.co</a>
</span><span style="color: #990000;">
<!–?php if(@$_POST[‘address’]==1){ ?–>
地址: 厦门市思明区厦禾路666号海翼大厦A座11层
<!–?php }?–>
</span>
<div></div>
</div>
<pre>
<!–<A href="javascript:Onclicklink()">点击我复制</A>–>
<script type="text/javascript" language="javascript">// <![CDATA[
<!– function Onclicklink() { var con = document.getElementById(‘con’); con.select(); //var str = con.innerHTML //window.clipboardData.setData("Text",str); //document.execCommand("Copy"); //setCopy(str); //alert("已复制"); } /* function setCopy(_sTxt){ try{ if(window.clipboardData) { window.clipboardData.setData("Text", _sTxt); } else if(window.netscape) { netscape.security.PrivilegeManager.enablePrivilege(‘UniversalXPConnect’); var clip = Components.classes[‘@mozilla.org/widget/clipboard;1’].createInstance(Components.interfaces.nsIClipboard); if(!clip) return; var trans = Components.classes[‘@mozilla.org/widget/transferable;1’].createInstance(Components.interfaces.nsITransferable); if(!trans) return; trans.addDataFlavor(‘text/unicode’); var str = new Object(); var len = new Object(); var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); var copytext = _sTxt; str.data = copytext; trans.setTransferData("text/unicode", str, copytext.length*2); var clipid = Components.interfaces.nsIClipboard; if (!clip) return false; clip.setData(trans, null, clipid.kGlobalClipboard); } }catch(e){} }*/ –>
// ]]></script>
<!–?php } ?–></pre>
<div class="cl"></div>
<hr />
<form action="" method="post">
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>English name</td>
<td><input id="enname" type="text" name="enname" value=""<?php" />"/></td>
</tr>
<tr>
<td>Chinese name</td>
<td><input id="enname2" type="text" name="enname2" value=""<?php" />"/></td>
</tr>
<tr>
<td>Position</td>
<td><input id="enname3" type="text" name="enname3" value=""<?php" />"/></td>
</tr>
<tr>
<td>Tel(optional)(+86-592-)</td>
<td><input id="enname4" type="text" name="enname4" value=""<?php" />"/></td>
</tr>
<tr>
<td>Mobile Phone(+86-)</td>
<td><input id="enname5" type="text" name="enname5" value=""<?php" />"/></td>
</tr>
<tr>
<td>Email</td>
<td><input id="enname6" type="text" name="enname6" value=""<?php" />"/></td>
</tr>
<tr>
<td>QQ(optional)</td>
<td><input id="enname7" type="text" name="enname7" value=""<?php" />"/></td>
</tr>
<tr>
<td>Skype(optional)</td>
<td><input id="enname8" type="text" name="enname8" value=""<?php" />"/></td>
</tr>
<tr>
<td>Address(optional)</td>
<td><input type="checkbox" name="address" value="1" checked="checked" />/></td>
</tr>
<tr>
<td>Language</td>
<td>English<input type="radio" name="lang" value="1" checked="checked" /> 中文<input type="radio" name="lang" value="2" /></td>
</tr>
</tbody>
</table>
<input type="submit" name="submit" value="Submit" /></form>
<pre>
[/code]
还有一个 广告生成代码工具: http://www.mechanist.co/tools/createcode.php
主要注意的是 中文字符需要转换成url专用字符: rawurlencode($hmkw)