本文整理汇总了PHP中smtp::sendmail方法的典型用法代码示例。如果您正苦于以下问题:PHP smtp::sendmail方法的具体用法?PHP smtp::sendmail怎么用?PHP smtp::sendmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类smtp
的用法示例。
在下文中一共展示了smtp::sendmail方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendEmail
protected function sendEmail($smtpemailto, $mailsubject, $text)
{
import("ORG.Util.Smtp");
$smtpserver = "smtp.126.com";
//SMTP服务器
$smtpserverport = 25;
//SMTP服务器端口
$smtpusermail = "tianyu0915@126.com";
//SMTP服务器的用户邮箱
//$smtpemailto = "tianyu0915@gmail.com";//发送给谁
$smtpuser = "tianyu0915";
//SMTP服务器的用户帐号
$smtppass = "122126382";
//SMTP服务器的用户密码
//$mailsubject = "[Ty]";//邮件主题
$mailbody = $text;
//邮件内容
$mailtype = "HTML";
//邮件格式(HTML/TXT),TXT为文本邮件
$smtp = new smtp($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
//这里面的一个true是表示使用身份验证,否则不使用身份验证.
$smtp->debug = FALSE;
//是否显示发送的调试信息
$result = $smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);
return $result;
}
示例2: sendEmail
/**
* Created by PhpStorm.
* User: master
* Date: 2016/3/2
* Time: 20:57
*/
function sendEmail($addr, $title, $body)
{
$smtpserver = "smtp.163.com";
//SMTP服务器
$smtpserverport = 25;
//SMTP服务器端口,一般为25
$smtpusermail = "cotestpublic@163.com";
//SMTP服务器的用户邮箱
$smtpuser = "cotestpublic";
//SMTP服务器的用户帐号
$smtppass = "cotest123";
//SMTP服务器的用户密码
$smtp = new smtp($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
//实例化邮件类
$emailtype = "HTML";
//信件类型
$smtpemailto = $addr;
//接收邮件方
$smtpemailfrom = $smtpusermail;
//发送邮件方
$emailsubject = $title;
//邮件标题
$smtp->debug = false;
//邮件主体内容
$emailbody = $body;
//发送邮件
$rs = $smtp->sendmail($smtpemailto, $smtpemailfrom, $emailsubject, $emailbody, $emailtype);
if ($rs != "") {
$rst = true;
} else {
$rst = false;
}
return $rst;
}
示例3: send_email
/**
*$to_email 发送的人
*$title 邮箱标题
*$content 有些内容
*/
function send_email($to_email, $title, $content)
{
require_once "email.class.php";
//##########################################
$smtpserver = "smtp.163.com";
//SMTP服务器
$smtpserverport = "25";
//SMTP服务器端口
$smtpusermail = "morton991@163.com";
//SMTP服务器的用户邮箱
$smtpemailto = $to_email;
//发送给谁
$smtpuser = "morton991@163.com";
//SMTP服务器的用户帐号
$smtppass = "userpeng123";
//SMTP服务器的用户密码
$mailsubject = iconv("UTF-8", "gbk", $title);
//邮件主题
$mailbody = iconv("UTF-8", "gbk", $content);
//邮件内容
$mailtype = "HTML";
//邮件格式(HTML/TXT),TXT为文本邮件
##########################################
$smtp = new smtp($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
//这里面的一个true是表示使用身份验证,否则不使用身份验证.
$smtp->debug = false;
//是否显示发送的调试信息
$smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);
}
示例4: email
function email()
{
global $dir;
//引入发送邮件类
require $dir . "www/smtp.php";
//使用163邮箱服务器
$smtpserver = "smtp.exmail.qq.com";
//163邮箱服务器端口
$smtpserverport = 25;
//你的163服务器邮箱账号
$smtpusermail = "r@.com";
//收件人邮箱
$smtpemailto = "xxxxxxxxxxqq.com";
//你的邮箱账号(去掉@163.com)
$smtpuser = "xxx@xxx.com";
//SMTP服务器的用户帐号
//你的邮箱密码
$smtppass = "xxxx";
//SMTP服务器的用户密码
//邮件主题
$mailsubject = "测试邮件发送";
//邮件内容
$mailbody = "PHP+MySQL";
//邮件格式(HTML/TXT),TXT为文本邮件
$mailtype = "TXT";
//这里面的一个true是表示使用身份验证,否则不使用身份验证.
$smtp = new smtp($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
//是否显示发送的调试信息
$smtp->debug = false;
//发送邮件
$smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);
}
示例5: sendEmail
function sendEmail($email)
{
//此处的$email变量是发送的目的邮件
//下面开始设置一些信息
$smtpserver = "smtp.qq.com";
//SMTP服务器
$smtpserverport = 25;
//SMTP服务器端口
$smtpusermail = "1261810665@qq.com";
//SMTP服务器的用户邮箱
$smtpemailto = $email;
//发送给谁(可以填写任何邮箱地址)
$smtpuser = "1261810665";
//SMTP服务器的用户帐号(即SMTP服务器的用户邮箱@前面的信息)
$smtppass = "xxx(xxx代表1261810665@qq.com的密码)";
//SMTP服务器的用户密码
$mailtitle = 'UNeed';
//邮件主题
$mailcontent = "<h1>您成功发送了一条电子邮件</h1>";
//邮件内容
$mailtype = "HTML";
//邮件格式(HTML/TXT),TXT为文本邮件
$smtp = new smtp($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
//这里面的一个true是表示使用身份验证,否则不使用身份验证.
$smtp->debug = false;
//是否显示发送的调试信息
$state = $smtp->sendmail($smtpemailto, $smtpusermail, $mailtitle, $mailcontent, $mailtype);
if ($state == "") {
echo "对不起,邮件发送失败!请检查邮箱填写是否有误。";
exit;
}
echo "恭喜!邮件发送成功!!";
}
示例6: sendmail
function sendmail($smtpemailto, $title, $content)
{
$rs = mysql_fetch_array(mysql_query("select * from sitinfo where id = 1;"));
$websmtp = $rs["websmtp"];
$email = $rs["email"];
$mailuser = $rs["mailuser"];
$smtpport = $rs["smtpport"];
$mailpassword = $rs["mailpassword"];
$smtpserver = $websmtp;
//SMTP服务器
$smtpserverport = 25;
//SMTP服务器端口
$smtpusermail = $email;
//SMTP服务器的用户邮箱
$smtpemailto = $smtpemailto;
//发送给谁
$smtpuser = $mailuser;
//SMTP服务器的用户帐号
$smtppass = $mailpassword;
//SMTP服务器的用户密码
$mailsubject = $title;
//邮件主题
$mailbody = $content;
//邮件内容
$mailtype = "HTML";
$smtp = new smtp($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
$smtp->debug = false;
//是否显示发送的调试信息
$smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);
}
开发者ID:wuleiyang,项目名称:SublimeText,代码行数:30,代码来源:email.php++++++++++++++++D%3A%5CProgram+Files%5CFlashFXP%5CCache%5C%7Eflashfxp%5C52C220D5_edit.tmp%5Cemail.php
示例7: date
function mail_notice()
{
//******************** 配置信息 ********************************
$smtpserver = "smtp.qq.com";
//SMTP服务器
$smtpserverport = 25;
//SMTP服务器端口
$smtpusermail = "707719848@qq.com";
//SMTP服务器的用户邮箱
$smtpemailto = 'keensting0712@163.com';
//发送给谁
$smtpuser = "707719848";
//SMTP服务器的用户帐号
$smtppass = "lx19950712jiao";
//SMTP服务器的用户密码
$mailtitle = '学校数据更新完毕!';
//邮件主题
$mailcontent = "<h1>更新时间:" . date('Y-m-d h:i:sa') . "</h1>";
//邮件内容
$mailtype = "HTML";
//邮件格式(HTML/TXT),TXT为文本邮件
//************************ 配置信息 ****************************
$smtp = new smtp($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
//这里面的一个true是表示使用身份验证,否则不使用身份验证.
$smtp->debug = false;
//是否显示发送的调试信息
$state = $smtp->sendmail($smtpemailto, $smtpusermail, $mailtitle, $mailcontent, $mailtype);
if ($state == '') {
echo 'failed';
}
}
示例8: eSmtp
function eSmtp($email)
{
//使用163邮箱服务器
$smtpserver = "smtp.163.com";
//163邮箱服务器端口
$smtpserverport = 25;
//你的163服务器邮箱账号
$smtpusermail = "yy_lfy@163.com";
//收件人邮箱
$smtpemailto = $email;
//"yy_lfy@126.com";
//你的邮箱账号(去掉@163.com)
$smtpuser = "yy_lfy";
//SMTP服务器的用户帐号
//你的邮箱密码
$smtppass = "yueyi@810718";
//SMTP服务器的用户密码
//邮件主题
$mailsubject = "测试邮件发送";
//$mailsubject = '=?UTF-8?B?'.base64_encode($mailsubject).'?=';
//邮件内容
$mailbody = "<p>PHP+MySQL测试邮件发送</p><p><a href=\"http://baidu.com\">baidu</a>";
//邮件格式(HTML/TXT),TXT为文本邮件
$mailtype = "HTML";
//这里面的一个true是表示使用身份验证,否则不使用身份验证.
$smtp = new smtp($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
//是否显示发送的调试信息
$smtp->debug = TRUE;
//发送邮件
$smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);
}
示例9: mail_core
function mail_core($smtpemailto, $mailtitle, $mailcontent, $mailtype)
{
$smtp = new smtp($GLOBALS["smtpserver"], $GLOBALS["smtpserverport"], true, $GLOBALS["smtpuser"], $GLOBALS["smtppass"]);
//这里面的一个true是表示使用身份验证,否则不使用身份验证.
$smtp->debug = false;
//是否显示发送的调试信息
$state = $smtp->sendmail($smtpemailto, $GLOBALS["smtpusermail"], $mailtitle, $mailcontent, $mailtype);
return $state;
}
示例10: password
public function password()
{
if (!IS_POST) {
_404("页面不存在");
}
$email = I('username', '', 'htmlspecialchars');
if (I("verify", "", "md5") != session("verify")) {
//验证码错误;
$this->ajaxReturn(array('status' => 2));
return 0;
} else {
// $this->ajaxReturn(array('status'=>1));//发送成功!
import('Class.smtp', APP_PATH);
date_default_timezone_set('Asia/Shanghai');
$time = time();
$appy_time = date('Y-m-d H:i', $time);
$data = M();
$sql = "select id from dm_user where username= '{$email}'";
$result = $data->query("select id from dm_user where username= '{$email}'");
$reset = $data->query("update dm_user set resettime={$time} where username ='{$email}'");
$id = base64_encode($result[0]['id']);
//使用base64对数据加密
$url = U('index/Password/reset?time=' . $time . '&yxs=' . $id . '&mail=' . $email);
$MailServer = 'smtp.163.com';
//SMTP 服务器
$MailPort = '25';
//SMTP服务器端口号 默认25
$MailId = 'daymeng@163.com';
//服务器邮箱帐号
$MailPw = 'checent.com';
//服务器邮箱密码
$Title = '呆萌网找回登陆密码!';
//邮件标题
$Content = '呆萌网在 ' . $appy_time . ' 收到了邮箱 ' . $email . ' 的密码重置申请。请点击以下的链接修改密码:
</br>
http://' . $_SERVER['HTTP_HOST'] . $url . '
</br>
如果邮箱中不能打开链接,您也可以将它复制到浏览器地址栏中打开。';
//邮件内容
$email = $email;
//接收者邮箱
$smtp = new smtp($MailServer, $MailPort, true, $MailId, $MailPw);
$smtp->debug = false;
if ($smtp->sendmail($email, $MailId, $Title, $Content, "HTML")) {
$this->ajaxReturn(array('status' => 1));
//发送成功!
} else {
$this->ajaxReturn(array('status' => 3));
//请重新发送
}
}
}
示例11: sendmail
/**
* 邮件发送函数
*
* @param string $email E-mail地址
* @param string $mailtitle E-mail标题
* @param string $mailbody E-mail内容
* @param string $headers 头信息
* @return void
*/
function sendmail($email, $mailtitle, $mailbody, $headers)
{
global $cfg_sendmail_bysmtp, $cfg_smtp_server, $cfg_smtp_port, $cfg_smtp_usermail, $cfg_smtp_user, $cfg_smtp_password, $cfg_adminemail;
if ($cfg_sendmail_bysmtp == 'Y') {
$mailtype = 'TXT';
require_once DEDEINC . '/mail.class.php';
$smtp = new smtp($cfg_smtp_server, $cfg_smtp_port, true, $cfg_smtp_usermail, $cfg_smtp_password);
$smtp->debug = false;
$smtp->sendmail($email, $cfg_webname, $cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype);
} else {
@mail($email, $mailtitle, $mailbody, $headers);
}
}
示例12: foreach
function mail_notice()
{
//******************** 配置信息 ********************************
$smtpserver = "smtp.qq.com";
//SMTP服务器
$smtpserverport = 25;
//SMTP服务器端口
$smtpusermail = "707719848@qq.com";
//SMTP服务器的用户邮箱
$smtpemailto = 'keensting0712@163.com';
//发送给谁
$smtpuser = "707719848";
//SMTP服务器的用户帐号
$smtppass = "lx19950712jiao";
//SMTP服务器的用户密码
$mailtitle = '订单数据审核完毕!';
//邮件主题
$mailcontent = '';
foreach ($this->mail_content as $v) {
$mailcontent .= $v . '<br>';
}
date_default_timezone_set('PRC');
$mailcontent .= "<h1>更新时间:" . date('Y-m-d h:i:sa') . "</h1>";
//邮件内容
$mailtype = "HTML";
//邮件格式(HTML/TXT),TXT为文本邮件
//************************ 配置信息 ****************************
$smtp = new smtp($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
//这里面的一个true是表示使用身份验证,否则不使用身份验证.
$smtp->debug = false;
//是否显示发送的调试信息
$state = $smtp->sendmail($smtpemailto, $smtpusermail, $mailtitle, $mailcontent, $mailtype);
$smtp->sendmail('502599073@qq.com', $smtpusermail, $mailtitle, $mailcontent, $mailtype);
//给石头发一份
if ($state == '') {
echo 'failed';
}
}
示例13: sendEmail
function sendEmail()
{
$smtp = new smtp($this->smtpserver, $this->smtpserverport, true, $this->smtpuser, $this->smtppass);
//这里面的一个true是表示使用身份验证,否则不使用身份验证.
$smtp->debug = false;
//是否显示发送的调试信息
$state = $smtp->sendmail($this->smtpemailto, $this->smtpusermail, $this->mailtitle, $this->mailcontent, $this->mailtype);
echo "<div style='width:300px; margin:36px auto;'>";
if ($state == "") {
return false;
} else {
return true;
}
}
示例14: sendmail
public function sendmail()
{
//include_once(ROOT_PATH."/application/controllers/mail.inc.php");
$smtp = new smtp("smtp.163.com", 25, true, "testacemap@163.com", "mxanahtmyfukwgxa", "testacemap@163.com");
//发件人信箱信息
$smtp->debug = TRUE;
//是否显示发送的调试信息 FALSE or TRUE
$mailto = "testacemap@163.com";
//收件人信箱
$mailsubject = "Feedback";
$mailfrom = "Acemap user";
$mailbody = "Name:" . $_POST["q1"] . "<br>";
$mailbody = $mailbody . "Phone No:" . $_POST["q2"] . "<br>";
$mailbody = $mailbody . "Suburb:" . $_POST["q3"] . "<br>";
$mailbody = $mailbody . "Email:" . $_POST["email"] . "<br>";
$mailbody = $mailbody . "Message:" . $_POST["q4"] . "<br>";
//其他的表单项目以此类推
$mailtype = "HTML";
//邮件格式(HTML/TXT),TXT为文本邮件
$mailsubject = '=?UTF-8?B?' . base64_encode($mailsubject) . '?=';
//邮件主题
$mailfrom = '=?UTF-8?B?' . base64_encode($mailfrom) . '?=';
//发件人
$smtp->sendmail($mailto, $mailfrom, $mailsubject, $mailbody, $mailtype);
echo "<script language=\"JavaScript\">alert(\"Send success.\");</script>";
echo "<script language=\"JavaScript\">history.go(-1);</script>";
exit;
/*
$this->load->library('email');
$config['smtp_host']='smtp.163.com';
$config['smtp_post']='25';
$config['smtp_user']='testacemap@163.com';
$config['smtp_pass']='mxanahtmyfukwgxa';
$this->email->initialize($config);
$this->email->from("testacemap@163.com","acemap");
$this->email->to('testacemap@163.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
echo $this->email->print_debugger();
*/
}
示例15: sendmail
function sendmail($email, $mailtitle, $mailbody)
{
global $cfg_sendmail_bysmtp, $cfg_smtp_server, $cfg_smtp_port, $cfg_smtp_usermail, $cfg_smtp_user, $cfg_smtp_password, $cfg_adminemail, $cfg_webname;
if ($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server)) {
$mailtype = 'HTML';
require_once DEDEINC . '/mail.class.php';
$smtp = new smtp($cfg_smtp_server, $cfg_smtp_port, true, $cfg_smtp_usermail, $cfg_smtp_password);
$smtp->debug = false;
if (!$smtp->smtp_sockopen($cfg_smtp_server)) {
ShowMsg('邮件发送失败,请联系管理员', '-1');
exit;
}
$smtp->sendmail($email, $cfg_webname, $cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype);
} else {
@mail($email, $mailtitle, $mailbody, $headers);
}
}