phpmailer

PHP trying to send mail securely - cannot find the PHPMailer class

泪湿孤枕 提交于 2019-12-23 15:57:53
问题 I started off with the following: composer require phpmailer/phpmailer Followed by placing require once require_once "../vendor/autoload.php"; Then $mail = new PHPMailer; That's where PHP has a fatal error: Fatal error: Class 'PHPMailer' not found The following is my code: use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; # require php mailer require_once "../vendor/autoload.php"; //PHPMailer Object $mail = new PHPMailer; $mail->isSMTP(); $mail->SMTPDebug = 3; $mail-

SMTP -> ERROR: RCPT not accepted from server

断了今生、忘了曾经 提交于 2019-12-23 08:54:57
问题 require("phpmailer.inc.php"); class sendmail { public static function sendAccountActivateMail($to,$subject,&message) { $flg = false; try { $mail= new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth= true; $mail->SMTPSecure= "tls"; $mail->Host= "smtp.gmail.com"; $mail->Port= 587; $mail->Username= "xxx@mydomain.com"; $mail->Password= "xxxxxx"; $mail->AddReplyTo("info@mydomain.com"); $mail->From= "info@mydomain.com"; $mail->FromName= "Website"; $mail->Subject= $subject; $mail->WordWrap= 50; $mail-

PhpMailer, sent attachment as other name

守給你的承諾、 提交于 2019-12-23 08:39:38
问题 I use phpmailer for sending email with attachment file = "/path/bla.csv"; require 'class.phpmailer.php'; $mail = new PHPMailer(); // some oprtions here $mail->AddAttachment($file); $mail->Send(); So, if use this code, email is sended with attach file, and file name is: bla.csv There is possible to change attach file name without renaming real file? that is, I need sent bla.csv file, but sent is as name some_other_name.csv How to make this? 回答1: Pass the desired name as second parameter $mail-

Joomla UTF-8 encoding fails on opening the mail

拥有回忆 提交于 2019-12-23 07:43:03
问题 I have a strange issue with encoding, described as follows: the ù is now shown as ù in the email subject. The email is sent through php mail function. When viewing the e-mail in the mailbox, it is shown correctly. However, when anybody opens the e-mail, the ù is suddenly changed to ù. Uw contact met Meeùs should be Uw contact met Meeùs i have already used the encoding. $emailsubject contains the above mentioned email subject. $subject=$emailsubject; $subject=$emailsubject; $email_message

Should I use PHPMailer or SwiftMailer? [duplicate]

强颜欢笑 提交于 2019-12-23 07:32:48
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: PhpMailer vs. Swiftmailer? I have always used PHP's built in mail() function and it has always worked for me without fail and does the job I want it to. Now some maybe thinking 'Why fix something that isn't broke ?'. My answer to these in case someone asks is: I have never used a framework before if that's what they are classified as or perhaps they are called a library I don't know. I want to start using one

Sending dynamic table in phpmailer

北城余情 提交于 2019-12-23 05:14:21
问题 I am having an issue with sending an email through php mailer. I am trying to send a dynamically populated table but I am only receiving the first row in the emails. If anyone has any knowledge on how I can send the full table in an email please share! Thank you! Here is my code where I am having issues. $mail->isHTML(true); // Set email format to HTML $mail->Subject = $_POST['subject']; While($row=mysql_fetch_assoc($result)){ $end_dt = $row['end_dt']; $dpd = floor((abs(strtotime(date("Y-m-d"

PHPMailer fails to send email via gmail SMTP service used by an organisation

你。 提交于 2019-12-23 04:45:25
问题 I am trying to send Emails from the Platform for every successful registration. I am using PHPMailer and this is my code: $mail = new PHPMailer(); $mail->IsSMTP(); $mail->CharSet = 'UTF-8'; $mail->Host = "smtp.gmail.com"; $mail->SMTPDebug = 0; $mail->SMTPAuth = true; $mail->Port = 25; $mail->Username = "<gmail login id>"; $mail->Password = "<something>"; $mail->setFrom('<subdomain>.<organisation domain>', '<org name>'); $mail->addAddress($email); $mail->Subject = 'First PHPMailer Message';

Connection Refused using PHPMailer with Namecheap Accounts

徘徊边缘 提交于 2019-12-23 01:12:30
问题 I have been using the code below to try to send emails out to people who sign up on my website however I can not get the code to work with my namecheap hosted email account. This namecheap email configuration was used but it seems to still give me an error. I have tried the same code with the hotmail settings and it works just fine. Error 2016-06-17 09:28:33 SMTP ERROR: Failed to connect to server: Connection refused (61) 2016-06-17 09:28:33 SMTP connect() failed. https://github.com/PHPMailer

Mailer Error: SMTP Error: data not accepted

ぐ巨炮叔叔 提交于 2019-12-22 12:43:14
问题 I want to send mail through PHP, so i am using PHPMailer. Don't know why i am getting this error. Mailer Error: SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: Relaying not allowed - sender domain not local SMTP code: 530 This is my code. require '../library/PHPMailer/PHPMailerAutoload.php'; $mail = new PHPMailer; $mail->IsSMTP(); //From email address and name $mail->From = "my@email.address"; $mail->FromName = "Full Name"; //To address and name $mail-

Mailer Error: SMTP Error: data not accepted

那年仲夏 提交于 2019-12-22 12:42:11
问题 I want to send mail through PHP, so i am using PHPMailer. Don't know why i am getting this error. Mailer Error: SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: Relaying not allowed - sender domain not local SMTP code: 530 This is my code. require '../library/PHPMailer/PHPMailerAutoload.php'; $mail = new PHPMailer; $mail->IsSMTP(); //From email address and name $mail->From = "my@email.address"; $mail->FromName = "Full Name"; //To address and name $mail-