Questions tagged [phpmailer]

PHPMailer is an email creation and sending class for PHP. PHPMailer is designed to communicate directly with other servers, unlike PHP's native `mail()` function.

PHPMailer is a PHP email creation and sending class featuring file attachments, SMTP servers, CCs, BCCs, HTML messages, word wrap, and more. Sends email via sendmail, PHP mail(), or directly with SMTP. Please make sure you download from the project page and not from older repos on SourceForge.

Useful links

5538 questions
22
votes
3 answers

How to use PHPMailer without composer?

I'd like to use the latest PHPMailer library with require_once() instead of messing around with Composer. I'd like a pure xcopy deployment with minimal fuss. Here's what I'm attempting to do: require_once("src/PHPMailer.php"); $mail = new…
HerrimanCoder
  • 6,835
  • 24
  • 78
  • 158
22
votes
12 answers

SMTP configuration not working in production

I'm trying to send an email when a form is submitted. I'm using PHPMailer to send the mail using the below configuration. $mail = new PHPMailer; $mail->isSMTP(); $mail->Host = 'mail.example.in'; $mail->Port = 25; $mail->SMTPAuth =…
Aakash
  • 1,751
  • 1
  • 14
  • 21
22
votes
2 answers

Gmail Sending Limits

I'm developing software on a website that uses PHPMailer to send mail through our company's Gmail accounts via SMTP. With the software, a customer signs up for the site and receives a receipt and a video ticket. Two separate emails per customer at…
22
votes
9 answers

Phpmailer AddBcc not working

I am using phpmailer to sent email, and it works the recipients receive the mail except the bcc and cc details is not showing the mail. Someone can suggest a solution to this . the code…
Vidya L
  • 2,289
  • 4
  • 27
  • 42
21
votes
17 answers

Could not instantiate mail function. Why this error occurring

When I'm trying to send mail through PHPMailer, i'm getting this error message. My code is below:
Rajasekar
  • 211
  • 1
  • 2
  • 3
21
votes
9 answers

PHPMAILER Not sending and not giving error

I am trying to let users fill out a contact form, which will then be sent to my email. But its not working for some reason. I just get a blank page with no error message or any text and email is also not sent. if (isset($_POST['submit'])) { …
Wale
  • 405
  • 1
  • 4
  • 10
21
votes
2 answers

Add HTML formatting in phpmailer

I am using PHP mailer to send an online form directly to email. I want to edit the form like this: $message = '

The following request was sent from: '

; $message .= '

Name: '.$name.'


'; $message .= '

Phone: '.$phone.'

TheLettuceMaster
  • 15,594
  • 48
  • 153
  • 259
20
votes
3 answers

Sending Plain text emails using PHPMailer

I have a problem sending plain text emails using PHPMailer. I have text that I read from a text file and mail it to mail recipient via PHPMailer When the recipient gets the actual email, the formatting of the mail is not like in the text file,…
Elitmiar
  • 35,072
  • 73
  • 180
  • 229
18
votes
9 answers

SMTP Error: The following recipients failed:XXXX

So i just received this error when trying to send an mail using PHPmailer from my site. SMTP Error: The following recipients failed: XXXX I tried to set $mail->SMTPAuth = true; to false but no result. And i tried to change the password for the mail…
Markus
  • 616
  • 1
  • 9
  • 24
18
votes
7 answers

Problem with SMTP authentication in PHP using PHPMailer, with Pear Mail works

I´m having trouble sending a e-mail with the PHPMailer class, but it works with PEAR Mail::factory. I guess the problem is with the SMTP authentication, but I couldn´t find the problem. The code with problem…
Evandro
  • 219
  • 1
  • 2
  • 7
17
votes
2 answers

PHPMailer sends with TLS even when encryption is not enabled

I am trying sending email using PHPMailer without TLS, but PHPMailer still tries to send email with TLS even if I do not enable it: include_once("PHPMailer-master\PHPMailerAutoload.php"); $To = 'some@site.com'; $Subject = 'Topic'; $Message = 'msg…
John Mendes
  • 781
  • 3
  • 9
  • 18
17
votes
1 answer

How to set a custom header using phpmailer

I am using phpmailer for sending emails, but I want to make a custom header for my company, by adding a textarea field that contain any custom header for example using a header like this one: exemple of header or any other header types.. How can I…
dravos
  • 313
  • 1
  • 3
  • 9
17
votes
1 answer

Add attachment through PHPMailer

I have this following piece of code of PHPMailer. The problem is, that the file uploads to the server successfully but the attachment is not sent in the mail. The attachment code seems right to the best of my knowledge. Please review the code and…
Ayush Khemka
  • 480
  • 2
  • 9
  • 22
17
votes
4 answers

Cant send email with correct characters with PHPMailer

I'm trying to send a e-mail with the PHPmailer class, but the html i send, is empty, or the characters are unconfigured, and without accents.
darkman
  • 993
  • 3
  • 13
  • 31
16
votes
2 answers

Set urgent option in phpmailer

How can I sent an mail with phpmailer with the option urgent set like in MS Outlook?
Muiter
  • 1,470
  • 6
  • 26
  • 39