当我尝试发送带有从数据库中获取数据的 php 文件附件的多封邮件时,在成功发送邮件后,当它到达 gmail 时,我在邀请.php 文件中得到空白链接,这意味着在发送邮件 php 文件后没有获取来自数据库的数据,因此它没有显示任何链接,但所有其他内容都显示良好,并且在 localhost php 链接中显示正确
这是我的代码
索引.php
<?php
if(!empty($_POST['invite'])) {
foreach($_POST['invite'] as $check) {
}
$import_emails = implode($_POST['invite'], ',');
$imp_eml = explode(',', $import_emails);
foreach ($imp_eml as $addr)
{
$mail->AddBCC($addr);
}
$mail = new PHPMailer();
$body = file_get_contents('invite.php');
$body = eregi_replace("[\]",'',$body);
$mail->MsgHTML($body);
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->From = 'info@myweb.com';
$mail->FromName = 'Someone';
$mail->Host = '********';
$mail->SMTPAuth = true;
$mail->Username = '*******';
$mail->Password = '*******';
if($mail->Send())
{
echo "success";
} else {
echo "failure";
}
}
?>
邀请.php
<?php
include("connect.php")
$customerid = $_REQUEST['customerId']; //comming from another page
$query = mysql_query("select * from table where customerId = '$customerid'");
while($fetch=mysql_fetch_array($query)) {
$prjid = $fetch['projectId'];
}
?>
Vote for my projects <?php echo '<a href="http://www.mywebsite.com/project-details/'.$c_id.'/'.$p_id.'/">here</a>'; ?>.<br/>
<a href="http://www.mywebsite.com/project-details/<?php echo $c_id.'/'.$p_id.'/'; ?>"><?php echo 'http://www.mywebsite.com/project-details/'.$c_id.'/'.$p_id.'/'; ?></a>
?>
你有什么想法吗?