phpmailer

How to use phpMailer isSMTP on Bluehost?

人盡茶涼 提交于 2019-12-01 06:32:18
问题 It's taken me days to get the right settings so I thought I would post a php script that works on Bluehost. In initial tests using isSMTP is faster than isMAIL. <?php require_once '../includes/phpmailer/PHPMailerAutoload.php'; $mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = "box1311.bluehost.com"; // specify bluehost as outgoing server $mail->SMTPSecure = "tls"; // sets the prefix to the server do not use ssl $mail->SMTPDebug = 3; // comment out if you don't

How to send PHP mailer to multiple email addresses received via MySQL query

纵饮孤独 提交于 2019-12-01 06:08:11
问题 I run a MySQL query to get firstname, lastname and email from a table where 'notify' is set to YES, like this below. And in the while loop, I create all the info which I then put into an array right after: $sql = "SELECT firstname, lastname, email, notify FROM guesses WHERE poolid = '$poolid' AND notify = 'yes'"; $getnotify = mysqli_query($connection, $sql); if (!$getnotify) { die("Database query failed: " . mysqli_error()); } else { while ($row = mysqli_fetch_array($getnotify)) {

PHPMailer: Using remote SMTP server, works under localhost, Connection refused (111) on remote server

白昼怎懂夜的黑 提交于 2019-12-01 05:35:52
问题 I've got a bizarre problem here. I'm trying to use PHPMailer to send an email, through SMTP. I have a website hosted by GoDaddy and it's that SMTP account that I'm trying to use to send the mail. It works if I execute my PHP file on my localhost server. It does not work if I execute my PHP file on GoDaddy's server. The error message I get is: SMTP -> ERROR: Failed to connect to server: Connection refused (111) I checked phpinfo on both localhost and the remote server. Both have smtp_port

PHPMailer $mail->From headers not working with gmail

我的梦境 提交于 2019-12-01 05:21:27
I'm using the following code to send a mail after a form submission with the PHP mailer class https://github.com/Synchro/PHPMailer . The mail sends and is received successfully. The only thing that isn't wokring is the following: $mail->From = $email; $email is the email that a user will enter on the form (it is set with a $_POST variable). I would like the email to appear that it's from the user who filled out the form, so I can hit reply and have it go to their email address. However, the "from" email address is being set as $mail->Username , i.e. the username from the gmail account that the

Unable to send mail through Google SMTP with PHPMailer

谁说胖子不能爱 提交于 2019-12-01 05:05:39
问题 I'm trying to send out mail using Google's SMTP in combination with PHPMailer, but I can't get it to work. This is my code: $mail->IsSMTP(); $mail->Host = "smtp.gmail.com"; $mail->SMTPAuth = true; $mail->SMTPSecure = "ssl"; $mail->Username = "myemail@gmail.com"; $mail->Password = "**********"; $mail->Port = "465"; First I do not fully understand what should be filled in as 'SMTPSecure', some say ' ssl ', other say ' tls '. Next for 'Port' I could enter '465' or '587'. But none of the

PHPMailer Hangs on Send

走远了吗. 提交于 2019-12-01 04:36:29
I had successfully setup a web app using WAMPSERVER on a desktop used by a few people internally, this used PHPMailer to an internal SMTP server without encryption or authentication and it worked. That desktop crashed and I've migrated to a "new" desktop. I had an SVN setup so I was even using most of the same files and config. One difference which might matter is that the old desktop was 64-bit and the new is 32-bit. This means I'm using different versions of WAMPSERVER. The mailer just hangs. I don't get a PHP error or a PHP timeout. I just never reach the end of my script. The crazy part

PHPMailer sending e-mails with the warning: This message may not have been sent by: foo@gmail.com Learn more Report phishing

痞子三分冷 提交于 2019-12-01 04:16:24
I am using PHPMailer to send automated e-mails from my website and while testing, I noticed that all e-mails sent by php mailer are generating the following warning on the recipients end: This message may not have been sent by: foo@gmail.com Learn more Report phishing I was wondering if there is a way to avoid this? PHP Mailer code: //mail functions require("mailer/class.phpmailer.php"); require("mailer/class.smtp.php"); require("mailer/class.pop3.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "relay-hosting.secureserver.net"; $mail->Port = 25; $mail->IsHTML(true); $mail-

phpmailer debug output to html variable

旧时模样 提交于 2019-12-01 04:06:10
Im looking to use php mailers debug information to display in a webpage. When I enable debugging it just echo's the string. This means that my html is out of order, I wish to therefor output as a variable so I can place the output html where i want it. $mail->SMTPDebug = 2; $mail->Debugoutput = 'html'; A recent change in PHPMailer allows Debugoutput to be a closure , so you can make it do whatever you like, for example to collect all the debug output and emit it later: $debug = ''; $mail->Debugoutput = function($str, $level) { $GLOBALS['debug'] .= "$level: $str\n"; }; //...later echo $debug;

SetFrom PHPMailer not working

时光总嘲笑我的痴心妄想 提交于 2019-12-01 03:33:05
I am using gmail SMTP to send the mail with the help of phpmailer library. It is sending mails fine but it is not sending from the mail address that I am setting in SetFrom address. Here is my code: <?php require 'phpmailer/class.phpmailer.php'; $mail = new PHPMailer; $mail->IsSMTP(); $mail->SMTPAuth = true; $mail->Host = "smtp.gmail.com"; $mail->Port = 587; $mail->Username = "myusername@gmail.com"; $mail->Password = "gmail_password"; $mail->From = 'donotreply@mydomain.com'; $mail->FromName = 'Admin'; $mail->AddAddress('Toreceiver@test.com', 'Receiver'); // Add a recipient $mail->IsHTML(true);

PHPMailer - OpenSSL Error

依然范特西╮ 提交于 2019-12-01 03:29:11
问题 Based on the example that PHPMailer provides i have the script below, date_default_timezone_set('Etc/UTC'); require './PHPMailerAutoload.php'; $mail = new PHPMailer; $mail->isSMTP(); $mail->SMTPDebug = 2; $mail->Debugoutput = 'html'; $mail->Host = 'smtp.gmail.com'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; $mail->Username = "myemail@example.com"; $mail->Password = "********"; $mail->setFrom('myMail@example.com', 'First Last'); $mail->addReplyTo('myEmail@example.com