以前都是利用mail函数或php教程ermail进行邮件发送,今天看这款利用qmail进行邮件发送,写法非常简单,是一款不错的工具.
<?php function send_check_mail($email, $subject, $uid, $buffer) { echo "hello"; $command = "/var/qmail/bin/qmail-inject " . $email; //qmail程序地址,$email是要发送的地址 $handle = popen($command, "w"); //打开管道 if (!$handle) { return false; } $from = "yangxuemei2012@phprm.com"; //发件人 fwrite($handle, "from: " . $from . "\n"); //往管道写数据 fwrite($handle, "return-path: " . $from . "\n"); fwrite($handle, "to: " . $uid . "\n"); fwrite($handle, "subject: " . $subject . "\n"); fwrite($handle, "mime-version: 1.0\n"); fwrite($handle, "content-type: text/html; charset=\"gb2312\"n\n"); fwrite($handle, $buffer . "\n"); pclose($handle); //关闭管道 return true; } $subject = "测试邮件"; $uid = $_post['uid']; //from信息 $content= "<html><body>".$u_email ." 您好!<br><br>谢谢,www.phprm.com!<br</body></html>"; //内容信息 $u_email = "machunjie2003@phprm.com"; //发送到的邮箱 if (send_check_mail($u_email, $subject, $uid, $content)) { echo "恭喜!发送投票邮件到您的邮箱!<br><br>请检查您的邮箱:<font color=#cc0033>".$u_email." </font><br><br>". $close; } else { echo "很不幸,发送投票邮件到您的邮箱失败,请重试或者联系开发人员。<br><br>". $close; }
文章链接:
随便收藏,请保留本文地址!

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

SublimeText3 Mac version
God-level code editing software (SublimeText3)

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Chinese version
Chinese version, very easy to use

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),

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function