phpmailer

PHPMailer sending double emails

霸气de小男生 提交于 2020-04-30 07:28:15
问题 I am working on theapplication that fetches clients emails from DB, stores them in a array, loop through the array and send email to each client individually. The problem occurred when PHPMailer is sending a double email to clients and also in and in one of emails "to" field contains both recepient address and in second email there is also a second clients emails as well. I consider this as a vulnerability. Here is my code: $array = [ 0 => 'email@gmail.com' , 1 => 'email2@gmail.com' ]; /

Sending PDF data via email using PHPMailer and html2pdf

梦想与她 提交于 2020-04-30 06:39:07
问题 Im trying to send PDF or PNG over email and nothing seems to work. Below is my LAST attemnt, I have read every single article here on SO and nothing sees to work what is suggested, can someone please help? I am using PHPMailer, html2pdf and html2canvas, both of those produce proper documents on click, just sending them to php mailer dos not work. I am getting documents that can not be opened... Below are my last attempts... With file_get_contents method i get 0 sized data. PDF attempt: var

PHPMailer returning no Error But Not Sending any Email(Live Server)

笑着哭i 提交于 2020-04-07 08:28:07
问题 I am using this code: <?php require ('PHPMailer/PHPMailerAutoload.php'); $mail = new PHPMailer; //$mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; $mail->SMTPAuth = true; $mail->Username = 'allthingsremainhere@gmail.com'; $mail->Password = 'password'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->SetFrom('youcanreply@lishup.com', 'Reply It! - LishUp'); $mail->AddAddress('techgoeshere@gmail.com', 'Tech'); $mail->Subject = 'First PHPMailer Message'; $mail->Body = 'Hi! This is my first e

Threading without In-Reply-To: Message-ID?

本秂侑毒 提交于 2020-04-07 06:33:56
问题 So our system is sending us email notifications regarding specific incidents. The problem is, things get really spammy and disorganized, and we really want to have our email client (Gmail) thread notifications regarding the same incident. So for instance: Email 1 is sent about incident 1. Email 2 is sent about incident 1. Gmail displays them in their own threads while we want them to appear as "replies" in the same thread. I thought all I needed was to append "Re: Subject Line" but that doesn

Threading without In-Reply-To: Message-ID?

拟墨画扇 提交于 2020-04-07 06:33:04
问题 So our system is sending us email notifications regarding specific incidents. The problem is, things get really spammy and disorganized, and we really want to have our email client (Gmail) thread notifications regarding the same incident. So for instance: Email 1 is sent about incident 1. Email 2 is sent about incident 1. Gmail displays them in their own threads while we want them to appear as "replies" in the same thread. I thought all I needed was to append "Re: Subject Line" but that doesn

PHP使用SMTP协议发送邮件

▼魔方 西西 提交于 2020-04-05 17:45:35
PHP开发者一般都是使用PHPMailer发送邮件,不知道你有没有看过它的源码呢?其实并不难,核心在于SMTP协议,下面我分享下如何不依赖PHPMailer来发送邮件。 我选择使用QQ邮箱的SMTP服务器,其他邮箱服务商比如网易、新浪都是可以的。 首先建立TCP连接: $hostname = 'smtp.qq.com'; // 邮件服务器 $port = 465; // 服务器端口 $username = 'crazymus@foxmail.com'; // 你的邮箱账号 $password = '*************'; // 你的邮箱密码,QQ邮箱使用的不是密码,是授权码,登录邮箱设置 $sendTo = '291445576@qq.com'; // 收件人 $socket = fsockopen('ssl://' . $hostname, $port, $errno, $errmsg); if (!$socket) throw new \RuntimeException('create socket failed', 1); 为什么要使用ssl连接?因为QQ邮箱提供了ssl加密的通道,我们和服务器之间的数据传输都将是加密的。你也可以不使用ssl连接,去掉ssh://前缀,使用端口25就行,但并不推荐这样。在如今复杂的互联网环境中,明文传输数据是非常危险的

Thinkphp5+PHPMailer实现发送邮件

早过忘川 提交于 2020-04-03 17:13:47
PHP发送邮件需要开启下面几个服务: SMTP:简单邮件传输协议,用来发送邮件 POP3:简单的邮件访问协议,单向的,本地对邮件的操作不会同步到邮件服务器,用来接收邮件 IMAP:是一种比POP3更复杂的邮件访问协议,是双向的,本地对邮箱的操作会同步到邮箱服务器,用来接收邮件 发送之前需要拥有自己的邮件服务器,测试的时候其实用自己申请的免费邮箱就行,不需要自己搭建服务器了,可能要配置邮箱的SMTP服务,大部分公共邮箱(163、qq等)为了安全默认是关闭的,需要手动开启。 网易邮箱配置 QQ邮箱配置 基本的介绍完之后,开始说怎么用(以QQ邮箱为例)。 一、开启服务 登陆QQ邮箱,顶部有设置按钮,点击账户,拉到最后,开启第一行的 POP3/SMTP 服务,开启之后会有一串密码,复制下来一会要用。 二、下载安装PHPMailer 1、从 github 上下载: https://github.com/PHPMailer/PHPMailer/ 2、使用 composer 安装: composer require phpmailer/phpmailer 如果只是发送邮件,只留phpmailer.php和smtp.php就行。在vendor文件夹下新建phpmailer文件夹,把下载的文件放到这个文件夹下,打开composer.json文件,在autoload下加入一行代码 phpmailer

Problem with PHPMailer.Failed to connect to server?

会有一股神秘感。 提交于 2020-03-26 03:02:25
问题 I'm rookie in PHP. I connected PHPMailer. I was training send an email, but I got error My code use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require ("vendor/autoload.php"); $mail = new PHPMailer(true); try { //Server settings $mail->SMTPDebug = 2; $mail->isSMTP(); $mail->Host = 'localhost'; $mail->SMTPAuth = true; $mail->Username = ''; -The mail I'm trying to send an email to $mail->Password = ''; - password of this email $mail->SMTPSecure = 'ssl'; $mail->Port = 465;

PHPMailer实现PHP邮件发送

自古美人都是妖i 提交于 2020-03-21 07:35:03
1.首先 是下载PHP Mailer http://code.google.com/a/apache-extras.org/p/phpmailer/ 2.解压 从中取出class.phpmailer.php 和 class.smtp.php 放到你的项目的文件夹,因为我们等下会引用到它们. 3.创建发送邮件的函数,其中你需要配置smtp服务器 function postmail($to,$subject = '',$body = ''){ //Author:Jiucool WebSite: http://www.jiucool.com //$to 表示收件人地址 $subject 表示邮件标题 $body表示邮件正文 //error_reporting(E_ALL); error_reporting(E_STRICT); date_default_timezone_set('Asia/Shanghai');//设定时区东八区 require_once('class.phpmailer.php'); include('class.smtp.php'); $mail = new PHPMailer(); //new一个PHPMailer对象出来 $body = eregi_replace("[\]",'',$body); //对邮件内容进行必要的过滤 $mail->CharSet =

Send files with phpmailer before uploading them?

霸气de小男生 提交于 2020-03-20 06:30:07
问题 I have a problem with sending emails with attachment by the phpmailer script. I have a working code if I want to add a single file to the mail. But when it comes to multiple files, it looks like they are not even uploaded. My code for a single file: if (isset($_FILES['file']) && $_FILES['file']['error'] == UPLOAD_ERR_OK) { $mail->AddAttachment($_FILES['file']['tmp_name'], $_FILES['file']['name']); if(!$mail->Send()) { header("Location: " . $returnErrorPage); } else { header("Location: " .