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
15
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,507
  • 3
  • 42
  • 84
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
  • 35,072
  • 73
  • 180
  • 229
15
votes
3 answers

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

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…
cloudxix
  • 416
  • 1
  • 6
  • 11
15
votes
4 answers

Persistent SMTP connection in PHPMailer

How to enable persistent SMTP connections in PHPMailer? I will send many emails, so with persistent connections probably I will get performance gain.
Paulo Coghi
  • 13,724
  • 14
  • 68
  • 90
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
  • 355
  • 4
  • 9
  • 17
14
votes
4 answers

insert image in mail body

How to insert image in mail body when user click on send button. I am using php mail
ZEESHAN IQBAL
  • 273
  • 2
  • 7
  • 21
14
votes
9 answers

Sending emails through SMTP with PHPMailer

I'm trying to send SMTP e-mails using PHPMailer, but I keep getting this error message, any ideas how to get rid of it? I'm trying to connect via SSL on port 465. SMTP -> FROM SERVER: SMTP -> FROM SERVER: SMTP -> ERROR: EHLO not accepted from…
cypher
  • 6,822
  • 4
  • 31
  • 48
14
votes
1 answer

Phpmailer having problems with Umlaut

I have a feedback form set up but it's unstable when it comes to umlaute (vowel mutation). E.g. sometimes it showes an 'ö' as 'ö' (correct), but then sometimes i get something weird like 'Hร¼ttenkäse' instead of 'Hüttenkäse'. Page Coding (in…
Ollie
  • 542
  • 7
  • 18
14
votes
2 answers

Laravel 5 and PHPMailer

Does anybody have a working example how I can work with PHPMailer in Laravel 5? In Laravel 4 it was quiet simple to use but the same method doesn't work in L5. Here it is what I did in L4: Added in composer.json: "phpmailer/phpmailer":…
Sas Sam
  • 681
  • 4
  • 10
  • 25
14
votes
1 answer

Make PHPmailer a "more secure app" for Gmail

What security can we implement in PHPmailer to make it a more secure app for Gmail? https://support.google.com/accounts/answer/6010255 I am using PHPmailer to send emails via Gmail. PS: I don't want to enable "access for less secure apps" here:…
mpower2k
  • 151
  • 1
  • 1
  • 4
14
votes
5 answers

Mail not sending with PHPMailer over SSL using SMTP

I am trying to use PHPMailer to send e-mails over SMTP but so far have had no luck. I've gone through a number of SO questions, PHPMailer tutorials and forum posts but still cannot get it to work. I'll document as many of my failed attempts as I can…
James Cushing
  • 718
  • 1
  • 9
  • 18
14
votes
2 answers

Could not connect to SMTP host

SMTP Error: Could not connect to SMTP host. Message could not be sent. Mailer Error: SMTP Error: Could not connect to SMTP host. I can't seem to find a way to make PHPMailer work under CentOS. Mail work just fine under Windows with XAMPP but I…
raz3r
  • 3,071
  • 8
  • 44
  • 66
13
votes
4 answers

PHPMailer to use Gmail as SMTP server.Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host

i am trying to use phpMailer to send confirmation messages to users via email. my code is this: IsSMTP(); // set mailer to use SMTP $mail->Host =…
13
votes
2 answers

File attachment with PHPMailer

I have an HTML form with the option to upload a file. I would like then to send that file as an attachment to the email address along with the rest of the form data. I'm using PHP Mailer and I get the form data to send: such as name, telephone…
Eli Nathan
  • 1,020
  • 2
  • 13
  • 35
13
votes
2 answers

PHPmailer without using SMTP

I've added the PHPMailer folder to my root folder on my web server and I just get an error that has to do with SMTP. Is there a way to use PHPMailer without needing to log into a mail account? Can I just have the server send the email to a…
Joseph Kreifels II
  • 554
  • 1
  • 4
  • 17