本文章是利用phpmailer来实现在线发送邮件功能的源码代码.
<!DOCTYPE html> <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; background-color: #CFCFCF; } input { line-height: 18px; height: 18px; border: 1px solid #CCCCCC; } img { border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 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=http://pic2.phprm.com/2014/01/21/mailfooterimg.jpg <tr> <td height="70"> </td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><input type="text" value="http://111cn.net/" size="60" /></td> <td height="40"><a href="#"><img src="/static/imghwm/default1.png" data-src="img/copy.gif" class="lazy" style="max-width:90%" style="max-width:90%" / alt="php 发送邮件代码 " ></a></td> </tr> </table></td> </tr> <tr> <td height="28">好友姓名: <input type="text" size="22" /> 邮箱地址: <input type="text" size="22" /> </td> </tr> <tr> <td height="28">好友姓名: <input type="text" size="22" /> 邮箱地址: <input type="text" size="22" /> </td> </tr> <tr> <td height="28">好友姓名: <input type="text" size="22" /> 邮箱地址: <input type="text" size="22" /> </td> </tr> <tr> <td height="28" align="right"><a href="#"><img src="/static/imghwm/default1.png" data-src="img/sendbtn.gif" class="lazy" style="max-width:90%" style="max-width:90%" / alt="php 发送邮件代码 " ></a></td> </tr> </table></td> </tr> </table> </form> </body> </html>
发送邮件处理功能页面mail.php
<?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 = "mailangel123"; // 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把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

PHP开发实践:使用PHPMailer发送邮件到MySQL数据库中的用户引言:在现代互联网建设中,邮件是一种重要的沟通工具。无论是用户注册、密码重置,还是电子商务中的订单确认,发送电子邮件都是必不可少的功能。本文将介绍如何使用PHPMailer来发送电子邮件,并将邮件信息保存到MySQL数据库中的用户信息表中。一、安装PHPMailer库PHPMailer是

在Web应用程序中,往往需要将邮件一次性发送给多个收件人。PHP是一种很流行的Web开发语言,而PHPMailer是一种常见的发送邮件的PHP类库。PHPMailer提供了丰富的接口,使得在PHP应用程序中发送邮件变得更加方便和易于使用。在本篇文章中,我们将介绍如何使用PHPMailer向多个收件人发送邮件的方法和步骤。下载PHPMailer首先需要在官网(

php除以100保留两位小数的方法:1、利用“/”运算符进行除法运算,语法“数值 / 100”;2、使用“number_format(除法结果, 2)”或“sprintf("%.2f",除法结果)”语句进行四舍五入的处理值,并保留两位小数。

如何使用Flask-Mail发送电子邮件随着互联网的发展,电子邮件已经成为了人们沟通的重要工具。在开发Web应用中,有时候我们需要在特定的场景下发送电子邮件,比如用户注册成功后发送欢迎邮件,或者用户忘记密码时发送重置密码邮件等。Flask是一款简单而又灵活的PythonWeb框架,而Flask-Mail是Flask框架下用于发送邮件的扩展库,本文将介绍如何

判断方法:1、使用“strtotime("年-月-日")”语句将给定的年月日转换为时间戳格式;2、用“date("z",时间戳)+1”语句计算指定时间戳是一年的第几天。date()返回的天数是从0开始计算的,因此真实天数需要在此基础上加1。

php判断有没有小数点的方法:1、使用“strpos(数字字符串,'.')”语法,如果返回小数点在字符串中第一次出现的位置,则有小数点;2、使用“strrpos(数字字符串,'.')”语句,如果返回小数点在字符串中最后一次出现的位置,则有。

查找方法:1、用strpos(),语法“strpos("字符串值","查找子串")+1”;2、用stripos(),语法“strpos("字符串值","查找子串")+1”。因为字符串是从0开始计数的,因此两个函数获取的位置需要进行加1处理。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools
