zoukankan      html  css  js  c++  java
  • php发送邮件处理功能页面去除重复的邮箱地址

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>--邀请好友参加</title>
    <style type="text/css">
    <!--
    body {
     margin: 0px;
     padding: 0px;
     font-size: 12px;
     
    }
    input {
     line-height: 18px;
     height: 18px;
     border: 1px solid #CCCCCC;
    }
    img {
     border-top- 0px;
     border-right- 0px;
     border-bottom- 0px;
     border-left- 0px;
    }
    * {
     margin: 0px;
     padding: 0px;
     list-style-image: none;
     list-style-type: none;
     background-repeat: no-repeat;
    }
    td {
     line-height: 22px;
     font-size: 14px;
     font-weight: 700;
     color: #276662;
    }
    -->
    </style>
    </head>

    <body>

    <form action="#" method="post" name="form">
    <table border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="572" height="227" valign="top" background="img/mailfooterimg.gif"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="70">&nbsp;</td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><input type="text" value="http://111cn.cn/" size="60" /></td>
                <td height="40"><a href="#"><img src="img/copy.gif" width="72" height="22" /></a></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="28">好友姓名:
              <input type="text" size="22" />
              &nbsp;&nbsp;
              邮箱地址:
              <input type="text" size="22" />        </td>
          </tr>
          <tr>
            <td height="28">好友姓名:
              <input type="text" size="22" />
              &nbsp;&nbsp;
              邮箱地址:
              <input type="text" size="22" />        </td>
          </tr>
          <tr>
            <td height="28">好友姓名:
              <input type="text" size="22" />
              &nbsp;&nbsp;
              邮箱地址:
              <input type="text" size="22" />        </td>
          </tr>
          <tr>
            <td height="28" align="right"><a href="#"><img src="img/sendbtn.gif" width="95" height="26" /></a></td>
          </tr>
        </table></td>
      </tr>
    </table>
    </form>
    </body>
    </html>
    发送邮件处理功能页面。

    mail.php

    <?

    require(dirname(__FILE__)."/mail/class.phpmailer.php"); //调用 phpmailer类型,如果没有phpmailer请点击这里下载phpmailer for php5/6 下载

    $array =  array_unique(Get_value('mail',1));//去除重复的邮箱地址

    $mail = new PHPMailer(); 
     $count =0; 
     $bad =0;
     $mail->IsSMTP();                                      // set mailer to use SMTP
     $mail->Host = "smtp.163.com";  // smtp1.example.com;smtp2.example.comspecify main and backup server
     $mail->SMTPAuth = true;     // turn on SMTP authentication
     $mail->Username = "mailangel1232881064151";  // SMTP username
     $mail->Password = "*******"; // SMTP password
     
     $mail->From = "mailangel123@163.com";
     $mail->FromName = "你的好友来信";
     $MailBody = '内容'

    $mail->AddReplyTo("mailangel123@163.com", "澳优");
       $mail->AddAddress($tmpmail,'您好!');
       $mail->WordWrap = 50;
       $mail->CharSet="GB2312";                                 
       //$mail->AddAttachment("/var/tmp/file.tar.gz");        
       //$mail->AddAttachment("/tmp/image.jpg", "new.jpg");   
       $mail->IsHTML(true);                            
       
       $mail->Subject = "你的朋友邀请你一起合影!";
       $mail->Body    = $MailBody;
       
       if(!$mail->Send())
       {
          $bad++;
          $mail->ClearAddresses();   
          $mail->ClearAttachments(); 
          
       }

    OK就完成了哦。

    ?>

  • 相关阅读:
    php操作redis cluster集群成功实例
    js算法-快速排序(Quicksort)
    如何编写自己的虚拟DOM
    一文带你看透kubernetes 容器编排系统
    SpringBoot AOP控制Redis自动缓存和更新
    机器学习中的numpy库
    时间戳转自定义日期格式和刚刚、十分钟前等友好日期格式
    Python数据处理实例
    Spark1.x和2.x如何读取和写入csv文件
    掌握这个Python小技巧,轻松构建cytoscape导入文件
  • 原文地址:https://www.cnblogs.com/cbryge/p/6164536.html
Copyright © 2011-2022 走看看