我正在尝试制作一个在线系统,人们可以在其中从系统内发送线索 html 电子邮件......
除了在富文本编辑器中添加链接时,我的一切都正常工作,并且源代码中的一切看起来都很好,但是当我查看收件箱中的电子邮件时,链接不起作用并已更改为:
x-msg://30/%22http://example.com/%22
我不明白...
我认为这是 html post 功能的问题,因为我通过$_POST
方法提交它并使用 html 表单...当我在下一页上回显语句时,链接是http://workwithmandy.co/%22http://phobes.com/%22
,这很奇怪,因为网站的根目录系统已开启http://workwithmandy.co/
。
关于为什么会这样的任何想法?
这是表格:
<form action="<?php echo $editFormAction; ?>" method="POST" name="form" id="sendemailform">
<fieldset>
<div class="emailtablecontainer">
<table width="525" border="0" cellspacing="10">
<tr>
<td><label>To:</label></td>
<td><select data-placeholder="Select Lead(s) To Email..." multiple="true" class="chzn-container-multi" name="selectleads"style="width:500px;">
<?php
do {
?>
<option value="<?php echo $row_rsAllLeads['Email']?>"><?php echo $row_rsAllLeads['FullName']?></option>
<?php
} while ($row_rsAllLeads = mysql_fetch_assoc($rsAllLeads));
$rows = mysql_num_rows($rsAllLeads);
if($rows > 0) {
mysql_data_seek($rsAllLeads, 0);
$row_rsAllLeads = mysql_fetch_assoc($rsAllLeads);
}
?>
</select></td>
</tr>
<tr>
<td><label>Subject:</label></td>
<td><input class="inputs" name="subjectfield" type="text"></td>
</tr>
<tr>
<td><label>Message:</label></td>
<td><textarea id="sendemailtextarea" name="messagefield"></textarea></td>
<script>
CKEDITOR.replace( 'sendemailtextarea',
{
toolbar : 'SendEmailToolbar'
});
</script>
</tr>
</table>
</div>
<input class="submitemailbuttonsprite submitemailbutton1" name="submitemail" type="submit" value="Send Email(s)">
</fieldset>
<input type="hidden" name="MM_insert" value="form">
</form>
这是实际的 PHP 代码:
<?php
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form")) {
echo $_POST['messagefield'];
$to = $_POST['selectleads'];
$subject = $_POST['subjectfield'];
$body = $_POST['messagefield'];
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: " . $row_rs_CurrentUser['FirstName'] . " " . $row_rs_CurrentUser['LastName'] . " <" . $row_rs_CurrentUser['Email'] . ">";
if (mail($to, $subject, $body, $headers)) {
} else {
echo("<p>Message delivery failed...</p>");
}
}
?>