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

5076 questions
20
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
  • 201
  • 1
  • 2
  • 3
20
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
  • 14,856
  • 42
  • 142
  • 248
20
votes
8 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,166
  • 4
  • 24
  • 40
19
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
  • 30,202
  • 72
  • 172
  • 224
17
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
  • 586
  • 1
  • 8
  • 23
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
  • 470
  • 2
  • 9
  • 22
17
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
  • 345
  • 1
  • 2
  • 10
17
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
  • 211
  • 1
  • 2
  • 7
16
votes
1 answer

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
  • 701
  • 3
  • 9
  • 18
16
votes
2 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
  • 973
  • 3
  • 13
  • 30
15
votes
5 answers

Changing the Return-path using PHPMailer

Is there a way to change the return-path using PHPMailer I did the following and it did not work $mail->AddCustomHeader('Return-path:test@email.co.za'); I'm using the following statement to send mails if(!$mail->Send()) { echo "Mailer…
Elitmiar
  • 30,202
  • 72
  • 172
  • 224
15
votes
7 answers

Setting up PHPMailer with Office365 SMTP

I am attempting to set up PHPMailer so that one of our clients is able to have the automatically generated emails come from their own account. I have logged into their Office 365 account, and found that the required settings for PHPMailer are: Host:…
JosephGarrone
  • 3,614
  • 2
  • 31
  • 59
15
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,358
  • 4
  • 21
  • 34
14
votes
5 answers

Sent mails with phpmailer don't go to "Sent" IMAP folder

in my CRM online system I control ingoing mails with IMAP protocol. Now I'm making sending mails with phpmailer and SMTP protocol. Everything is ok but I have one wierd thing. How to make sent with phpmailer script mails go to "Sent" IMAP folder?
piernik
  • 3,119
  • 3
  • 36
  • 71
14
votes
2 answers

How can i attach an image using Phpmailer?

I am using phphmailer and have attached an image, it shows only the image like an icon rather than image itself here is my code could you help. $mail->AddEmbeddedImage('2.jpg', '2img', '2.jpg'); $mail->Subject = "Order Form: Contact form…
Mary
  • 395
  • 4
  • 8
  • 17