FAQ Database Discussion Community


can't attach more than 8 mb in phpMailer v5

php,phpmailer
i am working with phpMailer v5. since today it was working fine but today i tried to attache two images with mail body which was 4.1 MB each. and it returned PHP fatal error. Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /PHPMailer-master/class.smtp.php...

SMTP gmail with PHPMailer

email,smtp,phpmailer
I have a problem with PHPMailer. Last month I did with the same script and worked great. This is the code: $alemail = '[email protected]'; //send email $mail = new PHPMailer; $mail->isSMTP(); $mail->SMTPDebug = 2; $mail->Host = 'smtp.gmail.com'; $mail->SMTPAuth = true; $mail->Username = '[email protected]'; $mail->Password = 'password'; $mail->SMTPSecure = 'tls'; $mail->Port...

php mail partially working with bunch of code in sent email

php,email,phpmailer
<?php $trip=$_POST['trip']; $sur_name=$_POST['sur_name']; $given_name=$_POST['given_name']; $contact_number=$_POST['contact_number']; $email_id=$_POST['email_id']; $boarding=$_POST['boarding']; $landing=$_POST['landing']; $onward_date=$_POST['onward_date']; $return_date=$_POST['return_date']; $to='[email protected]'; $subject='Booking Form Query'; $body= 'Sur Name: '.$sur_name."\n". 'Given Name: '.$given_name."\n". 'Contact Number: '.$contact_number."\n". 'Email: '.$email_id."\n". 'From: '.$boarding."\n". 'To: '.$landing."\n"....

PHPMailer “Relaying denied. Proper authentification required”

php,email,website,smtp,phpmailer
I have an issue with PHPMailer. I want to send an e-mail form myself to myself, when a certain form is filled on my website (with the informations of the form in it), but I can't get it to work. PHP doesn't send any error (I made sure it's enabled),...

phpmailer attachment failing whenever I execute file with cronjob/mail to outerside clients but works whenever I run script from command line

php,phpmailer
I upgraded my website emails (sent via AWS SES) to have an HTML format with an attached image a few days ago. I am using PHPMailer. When I do test runs either to an email on my domain or to my personal email - even in high volume - everything...

I cannot send mail with SwiftMailer or PHPMailer from Localhost using gmail

email,gmail,localhost,phpmailer,swiftmailer
I have recently been unable to send out mails through php on localhost. I use PHPMailer and SwiftMailer in different parts of the application. With SwiftMailer I get this: Connection could not be established with host smtp.gmail.com [ #0] With PHPMailer, the message is: SMTP Error: Could not connect to...

Laravel SMTP driver with TLS encryption

php,email,laravel,phpmailer
I'm trying to send an email with this configuration: return [ 'driver' => 'smtp', 'host' => 'mail.mydomain.com', 'port' => 26, 'from' => ['address' => '[email protected]', 'name' => 'Mailer'], 'encryption' => 'tls', 'username' => env('MAIL_USERNAME'), 'password' => env('MAIL_PASSWORD'), 'sendmail' => '/usr/sbin/sendmail -bs', 'pretend' => false, ]; When I submit the form...

How to send € or € sign in email subject using phpMailer class

php,phpmailer
I am sending email using PHPMailer. I want to send price in subject, e.g "Bid of Price 460 € has been placed". I used € and € in subject but it doesn't display properly. It shows &euro instead incase of &euro; What should I use to solve this? Here is...

How to send email from several users with phpmailer

phpmailer
How can I send an email from several users with phpmailer? I have several users on the Gmail, Yahoo, and Live. I want each of them to send 20 emails. require_once('class.phpmailer.php'); $tedadeuser=12; // number of users / gmail 12 / hotmail 10 / yahoo 11 $tedademail=1; // The username for...

Codeigniter PHP Mailer, Sender Info

php,email,codeigniter-2,phpmailer,contact-form
I'm using Codeigniter PHP Mailer which is hosted here: https://github.com/ivantcholakov/codeigniter-phpmailer/ and with gmail smtp it works flawless. However,using it for a standard contact form, when visitors use that contact form and send us an email, they basically send mails from our mail address to our another mail addess. When they...

PHPMailer not sending

php,phpmailer
I am trying to create a contact form using PHP mailer.. it shows no error but I do not receive the email. I also tried to use the mail() function but it also not working.. Here's my PHP code <?php if (!empty($_POST['email']) && !empty($_POST['message'])){ $errors = array(); $to = "[email protected]";...

Feedback Form jQuery returns no data

php,jquery,html,ajax,phpmailer
I have an html page with an ajax query to a php file. This php file is supposed to send a message and then provide a response back to the ajax query. However, no matter what I do I can't get any response out of this ajax call. What am...

How to send to BCC address when using PHPMailer to format MIME message for Gmail API?

php,gmail,phpmailer,mime,bcc
I am using PHPMailer to build an email message. I am using PHPMailer only for MIME message formatting, not sending. I then extract the raw message from the PHPMailer object before passing it on to the Gmail API for processing. //Create a new PHPMailer instance $mail = new PHPMailer; //Tell...

SMTP ports - SSL vs non-SSL

security,ssl,phpmailer
I was told today by a support rep at SMTP.com that regardless of whether we connect via SSL or non-SSL, the data is secure as if it is going via SSL. I'm no genius, but I'm also not a complete idiot. And I have a strong feeling that this guy...

Send mail using gmail from php in localhost

php,gmail,phpmailer
im already know how to use phpmailer but i cant send mail wich are using gmail (i have in phpmailer all the configuration done like port, server name, etc) becouse it are using OAuth 2.0 and i already get my clien id an all that but im getting this error:...

PHP Mailer change FROM NAME

php,email,webpage,phpmailer
I have managed to send a mail to myself using this code. $mail = new PHPMailer; //$mail->SMTPDebug = 1; //Email server info $mail->isSMTP(); $mail->Host = 'smtp-mail.outlook.com'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; //User authentication info $mail->SMTPAuth = true; $mail->Username = '******@hotmail.com'; $mail->Password = '********'; //Email info $mail->From = '[email protected]'; $mail->FromName...

PHPMailer sent but not delivered

phpmailer
I have this debug code from my PHPMailer, it says the message was successfully sent, but I don't see any incoming email on my Gmail and other email. I've checked SPAM folder too, but nothing there. here's the debug message : 2015-02-03 03:44:33 Connection: opening to localhost:26, t=300, opt=array (...

SMTP error while using PHPMailer for gmail even after connecting to gmail SMTP

php,gmail,phpmailer
I am trying to send mails from my "gmail" account using PHPMailer, operating from localhost. I am getting an error like this in my browser: Connection: opening to ssl://smtp.gmail.com:587, timeout=300, options=array () SMTP ERROR: Failed to connect to server: (0) SMTP connect() failed. Mailer Error: SMTP connect() failed The php...

Replying to other email

email,phpmailer
I'm building webmail with PhpMailer. I need advice about replaying to other email. How to attach previous email? Should I simply attach it as a file - I think it's not good. I prefer attach email text, but how? Using only blockquote? But what about previous mail's styles? I see...

PHP Contact Form Mail Function Not Working

php,html,phpmailer,contact-form
I've been trying to implement a PHP contact for for a website, which seems admittedly like something I shouldn't be stuck on, but I keep running into trouble. I've been putting my HTML and PHP in separate files which I figure is good practice, so my setup looks like this:...

FORM: Name as sender instead of e-mail.

php,html,forms,phpmailer
I have a very basic form that uses PhpMail to send it's content but is there some way to change the "sender name" of the form from an e-mail adress to a name. Example: Instead of "from: [email protected]" it says "From: Ello Recruitment" or whatever. Here's the code i'm currently...

PHP Mailer ensure authenticity

php,phpmailer
I was just introduced to PHP mailer , it is great .U can attach things and do all sorts of stuff.WOW, my question is that since it gives us the freedom of sending the mail by any name or email id , so how does one ensure that no one...

Why mail is not going?

php,email,phpmailer
$sql="insert into landing_client_data(name,email,contact_no,company,ip,city,region,country,postal,utm_source,utm_medium,utm_term,utm_campaign,created_date) values('".$_POST['name']."', '".$_POST['email']."', '".$_POST['phone']."','".$_POST['company']."','".$ip."', '".$city."', '".$region."', '".$country."', '".$postal."', '".$utm_source."', '".$utm_medium."', '".$utm_term."', '".$utm_campaign."', '".$created_date."')"; $res=mysql_query($sql); //**AFTER THIS I DON'T KNOW WHETHER ITS GOING INSIDE 'if($res)' OR NOT**...

PHP mail() function & PHMailer doubts

php,email,phpmailer
I have few doubts regarding the mail options in PHP. Whatever I have read, I can not send mail from localhost without SMTP. Is it correct ? For sending the mail from localhost using the PHP mail() function, I need to make few changes in these two files. one is...

PHPMailer: Mass Emails - Send all variable messages at once, instead of individually

php,email,loops,variables,phpmailer
i'm currently trying to figure out the best way to do this. The current system i've made sends email one by one and fills in the information for each entry as in the array, such as email, first name and last name. The problem here is if i send alot...

Is it possible to instruct PHP to use postfix configuration in php.ini?

php,phpmailer,ubuntu-14.04,postfix-mta
Is it possible to configure PHP to send email using the configuration set for postfix? WordPress (via PHPMailer) relies on these settings to be correct in php.ini: ;SMTP = localhost ; http://php.net/smtp-port ;smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from ;sendmail_from = [email protected] ; For Unix only. You may...

SMTP connect() failed phpmailer

php,phpmailer
require 'PHPMailer-master/PHPMailerAutoload.php'; $mail = new PHPMailer(); $mail->SMTPDebug = 1; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp.mail.yahoo.com'; // Specify main and backup SMTP servers $mail->SMTPSecure = "ssl"; $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'myemail'; // SMTP username $mail->Password =...

How to show updated time for DST countries?

php,datetime,phpmailer,dst
I am showing time for different time-zones and the problem is that my server is running PHP v5.3.25 whereas on my local computer I have v5.5.9 When I set a specific time-zone and display its time, my local computer shows it just fine but the server does not add hours...

Trying to send mail to user and admin at same time

php,phpmailer
<?php include("include/head.php"); include("include/headder.php"); if(isset($_POST['submitfrm'])) { if($_REQUEST['captchares'] != 1) { echo "<script> window.location='page-full-width.php?capterror'; </script>"; exit; } else { $username=$_REQUEST['username']; $useremail=$_REQUEST['useremail']; $mobile=$_REQUEST['mobile']; $comment=$_REQUEST['comment']; $contact=mysql_query("INSERT INTO `contactus` (`username`, `useremail`, `mobile`, `comment`) VALUES ('$username', '$useremail', '$mobile', '$comment')");...

How can I change font in phpmailer?

php,phpmailer
I'm planning to send an email with a font style of "century gothic" when received. I hope somebody can help me with my problem. I'm very thankful for your answers. this is my code $mail->Body = " <html> <head></head> <body> <b>Request ID:</b> $bodystring <br> <b>Type:</b> $bodystring1 <br> <b>Request:</b> $bodystring2 <br>...

how to call php function with parameters in href html tag

php,html,phpmailer
I want to call sendEmail($email) function with it's parameters in the href tag when I click on the link I get a page wrote in it FORBIDDEN "you don't have permission to access the root folder on this server" <?php require 'PHPMailer-master/PHPMailerAutoload.php'; function sendEmail($email) { $mail = new PHPMailer; $mail->isSMTP();...

How do I add script to the mail send using phpmailer?

javascript,php,email,phpmailer
Mail Code in PHP: $mail->isHTML(true); // Set email format to HTML $mail->Subject = 'Training Program'; $mail->Body = "<html><head><script type = "."text/javascript"." "."src = "."pgm_mgmt.js"."></script>Dear<b> ".$trainername[$i].","."</b>"."<br><br>I'd like to know if you can attend the "."<b>".$trainerpgmname."</b>"." held at "."<b>".$trainercompany."</b>"." on "."<b>".$trainerdate."</b>"."<br><br>You can either accept or reject the...

php - Gmail doesn't accept emails that contains links

php,email,gmail,phpmailer
I am using PHPmailer to send emails that contain activation codes to the people who have signed up on my website. Everything worked fine with Yahoo! but not with Gmail. There is no errors in my PHP script. Everything looked okay. I tried to remove all the links from the...

GMX contact form

php,email,phpmailer,contact-form
I'm trying to create a simple SMTP-contact form with the help of phpMailer for my homepage but it's not working. It should forward the information of the fields "name, mail, subject, message" to my mailbox (in this case "name, mail, subject, message"). The input fields are also named "name, mail,...

Gmail Account SMTP -> ERROR: Failed to connect to server: Connection refused (111)

php,email,phpmailer,google-apps
Im using phpmailer to send emails using google business apps. Everything was running fine but since last three days, I've started to get the following error SMTP -> ERROR: Failed to connect to server: Connection refused (111) The following From address failed: [email protected] The strange thing is that, this doesn't...

phpmailer prints long list of details (CLIENT -> SERVER) when sending email

php,email,phpmailer,mailer
I have got a script working with PHPMailer. When i run it to send an email, the PHPMailer send the email successfully. But ALSO echo long list of email sending information (CLIENT -> SERVER) like: SERVER -> CLIENT: 220-server.mywebsitese.com ESMTP Exim 4.84 #2 Tue, 27 Jan 2015 08:37:57 +0200 220-We...

PHP- Sending a daily email

php,email,phpmailer
I am making a website that sends people who sign up for it an email every day in the morning. The problem I have run into is that I don't know how to send an email at the same time everyday in php. I do know how to send an...

send attachment from form with phpmailer not working

php,forms,attachment,phpmailer
After searching stackoverflow i didnt get any answer to my problem. The problems is that i have a form with upload button so when the user submits a file that will be emailed to me immediately. I use phpmailer but i only get message instead of message + attachment. Any...

Add self signed certificate using PHPMailer on Gmail account

php,gmail,phpmailer
Is it possible to use self signed or dedicated certificates on a Gmail account with the library PHPMailer? How to do this? And is this a secure option?

Change phpmailer's FROM address

php,email,phpmailer
How is phpmailer's FROM address changed? I expected the following to work, however, all emails sent use the the send from email address set by the first occurrence of SetFrom(). $mail = new myPHPMailer(true); $mail->SMTPDebug=2; $mail->Subject = "My Subject"; $mail->MsgHTML('My Message'); $mail->AddReplyTo('[email protected]'); $mail->ClearAllRecipients(); $mail->SetFrom('[email protected]'); $mail->AddAddress("[email protected]"); $mail->Send(); $mail->ClearAllRecipients();...

Trouble with email sending in ModX Revolution via FormIt

email,phpmailer,modx,modx-revolution
There is the trouble with email sending in Modx Revolution. Using FormIt plugin. I tried to enable Gmail SMTP at Modx settings list, but the same thing. Now SMTP disabled. Using such FormIt call: [[!FormIt? &hooks=`email,redirect` &redirectTo=`19` &redirectParams=`{"success":"1"}` &emailTpl=`feedbackEmailTpl` &emailSubject=`New request from [[++site_name]]` &emailTo=`***@gmail.com` &emailToName=`Support` &emailReplyTo=`***@gmail.com` &emailFrom=`***@gmail.com` &emailFromName=`***@gmail.com`...

Php email not sending

php,email,phpmailer
My code snippets are attached below. I've managed to get this working on another page, so I simply copied and pasted that process and front end code and changed the variables to the new page and it's not working. My PHP logs don't indicate anything is undefined and it's not...

How to use PHPMailer only for checking login password?

linux,email,smtp,phpmailer
I want to use PHPMailer to send email. However, the first step I only want to check whether user's password is correct. If it is correct, next step is to notice user to write receiver's email address. For example: <?php include('snail_database.txt'); require_once('/var/www/PHPMailer_5.2.4/class.phpmailer.php'); $mail = new PHPMailer(); $mail -> CharSet='utf-8'; $mail...

PHPMailer Mass mailing using BCC and catching not successfull email addressses

php,email,phpmailer
I am trying to send NewsLetter to 1500 users using PHPMailer and my SMTP servers. I have tried sending the mails to 2 BCC emails for test, and it sucessfully sent mails. But before I go ahead and send the mail to 1500 email address, I have few questions. I...

Mail Sending, Line break & and From header using gmail smtp

php,email,phpmailer
i send email with PHPMailer, my code is: $mail = new PHPMailer(true); $mail->Mailer = "smtp"; $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPDebug = 0; $mail->SMTPSecure = 'tls'; $mail->Host = "smtp.gmail.com"; // SMTP server $mail->Username = "[email protected]"; $mail->Password = "****"; $mail->addCustomHeader('Content-Type: text/plain; charset="utf-8"'); $mail->SMTPAuth = true; $mail->Port = 587;...

How to resolve 'SMTP Error: Could not connect to SMTP host.' in phpmailer?

php,phpmailer
I'm trying to send email using my gmail account but i am getting an error "SMTP Error: Could not connect to SMTP host". I have tried port 587,465 25 but still its not working. <?php if(isset($_POST['submit'])) { $message= 'Full Name: '.$_POST['fullname'].'<br /> Subject: '.$_POST['subject'].'<br /> Phone: '.$_POST['phone'].'<br /> Email: '.$_POST['emailid'].'<br...

SMTP Connection fails with TLS activated

php,email,ssl,phpmailer,starttls
I am using the PHPMailer to send E-Mails to my customers. I want to send them using SSL/TLS, but this doesn't work. I am using an original example script from PHPMailer. When I comment this line: $mail->SMTPSecure = 'tls'; and change the credentials to my non ssl SMTP it works...

Can I use a remotely hosted phpmailer file to send email from static html page?

phpmailer
Here is what I want to do: I have a static shared web page on dropbox, since dropbox is not a server it cannot send mail via php. My page has an email form, and I wish to point it to a phpmailer file I host on my regular hosting...

SMTP ERROR: unable to connect

php,phpmailer
i am getting this error kindly help me 2015-03-06 10:43:16 SMTP ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061) 2015-03-06 10:43:16 SMTP connect() failed. Message could not be sent.Mailer Error: SMTP connect() failed. my code is <?php require 'classes/class.phpmailer.php';...

PHPmailer SMTP domain level

php,email,phpmailer
I should connect to an smtp authenticated server, then use a specific mailbox to send emails, because the stmp server is authenticated ad a level domain. According to my provider, credentials are: Server authsmtp.domain.com User: [email protected] Password: *** But I want to send emails from [email protected], not [email protected] How can...

Convert addresses from name to phpmailer format

php,phpmailer
We have been using PEAR Mail but as this hasn't been maintained for a while I am wanting to convert to PHPmailer instead. We have an existing email class which wraps the actual mailer so conversion isn't looking too difficult so far. The problem I have run into is that...

Mailer Error: SMTP connect() failed in php mailer( https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting) [duplicate]

php,email,phpmailer
This question already has an answer here: SMTP connect() failed PHPmailer - PHP 2 answers Here is code for sending email from localhost after i referred a lot from online. html form: <form method="post" action="email.php"> Email: <input name="email" id="email" type="text" /><br /> Message:<br /> <textarea name="message" id="message" rows="15" cols="40"></textarea><br...

PHPMailer 5.2.x - Centrally set PHPMailer SMTPAuth credentials

phpmailer,smtp-auth
We inherited an older PHP application. It is an online shop application coded in weird style. Each mail procedure has been coded into the responsive PHP file on the fly. There are lots of files which can hold code to send out mails. Problem is, the new webserver uses a...

Sending e-mail via PHPMailer with attachments from URL

php,phpmailer
I'm using PHPMailer. I have to send two attachments and both are links (one is base64 image and the second one is url). // Variables with images $croped_img = 'data:image/jpg;base64,/extreme_long_code_here'; $photo_thumbnail_url = 'http://t2.ftcdn.net/jpg/00/76/44/75/400_F_76447580_gOWAV0P8APW0iC51OsW5huD6qoiEsh7O.jpg'; // PHPMailer $mail->addAttachment('$photo_thumbnail_url', 'selected.jpg'); $mail->addAttachment('$croped_img', 'croped_img.jpg'); PHPMailer works because if I send e-mail in that form, attachments...

Reusing PHPMailer to send out a second email?

php,phpmailer
I am working on an ordering system, which will need to send the customer, distributor and the website owner an email. The owner and distributor can get the same email (order details etc), but the customer needs one with a slightly different body to incorporate a thank you message. Currently...

PHPMailer not sending e-mail through Gmail, returns blank page

php,email,gmail,phpmailer,send
I am trying to set up a contact form at the bottom of my page. I am using PHPMailer and trying to receive emails at my gmail account. Every time I submit the form, my url changes to url/email.php and I get a blank page. What am I doing wrong?...

How to disable the message “could not access file” in PHP mailer?

php,email,phpmailer,email-attachments
I am using PHPMailer for sending mail from form with multiple attachments. This is a part of the form: Attachment:<br /> <input type="file" name="attach1" id="attach1" /> <input type="file" name="attach2" id="attach2" /> <input type="file" name="attach3" id="attach3" /> When a user attaches only 1 or 2 files, I added some condition in...