dtm37893 2016-06-01 05:48
浏览 60

如何将从数据库中检索到的网页作为电子邮件发送到多个电子邮件

I have a registration page, after the the registration the form will be generated to the applicant(containing all the form field which was filled by each applicant) which i retrieved form the database, Now i want the generated form to be send as a mail to multiple emails (which was provided by the applicant during the registration. Here is the code for the form Retrieval and its responding i just want this page to be send as a mail to multiple emails like i stated above. Thank you.

    <?php 
$query = "";
include("includes/connect.php");
?>
<?php
if(isset($_GET['name1'])) {
$sql = "SELECT *FROM intern_form WHERE unique_no='".$_GET['name1']."';";
$row = mysql_fetch_array(mysql_query($sql));
}
?>

<p>The Registrar,</p>
<p><?php echo $row['institution']; ?></p>
<p><?php echo $row['institution_address']; ?></p>
<p align="center"><strong>RE: APPLICATION FOR <?php echo    $row['it_duration']; ?> INDUSTRIAL TRAINING:</strong></p>

Dear Sir/Ma,

This is to inform you that the above named student has been accepted for industrial attachment.

I hereby comfirm that we would be in a position to offer Industrial Training in our Directorate(ITeMS).

Please find attached schedule of duty during the attachment.

Thank You.

Yours faithfully,

Signature

  • 写回答

1条回答 默认 最新

  • douxi1968 2016-06-01 05:57
    关注
    <?php
    // send to multiple emails
    $to  = 'friend1@example.com' . ', '; // first
    $to .= 'friend2@example.com' . ', '; // second and other (with .=)
    
    
    $subject = "Thanks for register";
    $message = '
    <html>
        <head>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <title>Thanks for register</title>
        </head>
        <body>
            <p>Dear Sir/Ma,</p>
            <br>
            <p>This is to inform you that the above named student has been accepted for <p>industrial attachment.</p>
            <br>
            <p>I hereby comfirm that we would be in a position to offer Industrial Training in our Directorate(ITeMS).</p>
            <br>
            <p>Please find attached schedule of duty during the attachment.</p>
            <br>
            <p>Thank You.</p>
            <p>Yours faithfully,</p>
            <p>Signature</p>
        </body>
    </html>';
    
    
    $headers  = 'MIME-Version: 1.0' . "
    ";
    $headers .= "Content-type: text/html; charset=utf-8 
    ";
    
    
    $headers .= "From: yournick <yournick@example.com>
    ";
    $headers .= 'Cc: secondnick@example.com' . "
    "; // if you want to send a copy to yourself or anybody
    
    mail($to, $subject, $message, $headers);
    ?>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?