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
58
votes
8 answers

PHPMailer generates PHP Warning: stream_socket_enable_crypto(): Peer certificate did not match expected

I am using PHPMailer on PHP 5.6, the increased security around certificated in PHP 5.6 is certainly fun. I am trying to send a test message to a domain hosted on dreamhost, the error that comes back from PHPMailer is: Could not connect to SMTP…
Rob Gunsuka
  • 705
  • 1
  • 5
  • 9
53
votes
18 answers

Phpmailer error "Could not instantiate mail function"

I'm using the mail() basic example modified slightly for my user id and I'm getting the error "Mailer Error: Could not instantiate mail function" if I use the mail function - mail($to, $subject, $message, $headers); it works fine, though I'm…
sdfor
  • 6,324
  • 13
  • 51
  • 61
51
votes
17 answers

phpmailer - The following SMTP Error: Data not accepted

I'm trying to figure out this issue for 6 hours. But there is nothing to make sense. Here is the scenario; There is a well formatted HTML template. $mail_body = ' Message Num : 769
Message Date : 2013-04-08 09:03:21
Yasin Yörük
  • 1,500
  • 7
  • 27
  • 51
45
votes
6 answers

How do I prevent mails sent through PHP mail() from going to spam?

I am using PHP's mail() function to send emails (sendmail process is running). But all the mails are going to spam (in case of gmail). I have tried many tricks that I found on the net but none is working, please tell me about any sure-shot trick.
Partyboy
  • 478
  • 1
  • 4
  • 7
41
votes
13 answers

Fatal error: Class 'PHPMailer' not found

I tried :include_once('C:\Inetpub\wwwroot\php\PHPMailer\PHPMailerAutoload.php'); Fatal error: Class 'PHPMailer' not found in C:\Inetpub\wwwroot\php\index.php on line 151 I place the PHPMailerAutoload.php in the same directory as my script. Can…
iori
  • 3,236
  • 12
  • 43
  • 78
39
votes
5 answers

PHPMailer AddAddress()

I don't know how the data should be formatted for AddAddress PHPMailer function; I need the email to be sent to multiple recipients so I tried $to = "me@example.com,you@example.net,she@example.it"; $obj->AddAddress($to); but with no success.
kmunky
  • 15,383
  • 17
  • 53
  • 64
36
votes
1 answer

Debugging PHP Mail() and/or PHPMailer

I'm quite stuck with a problem sending mail from a PHP script. Some data: Shared hosting, no SSH access, only hosting provider panel PHP version 5.2.5 Last year I built a site which had no problems sending mail with the same hosting Let's say the…
Agos
  • 18,542
  • 11
  • 56
  • 70
30
votes
6 answers

sending email via php mail function goes to spam

I am facing problem in sending mail to my inbox (gmail account) but everytime it goes to spam folder. Here is the code snippet //$ticketDetail is array which contain required information to send. …
Dinesh Nagar
  • 768
  • 2
  • 11
  • 23
27
votes
10 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
  • 4,081
  • 3
  • 38
  • 61
27
votes
2 answers

PHPMailer attachment, doing it without a physical file

So: // Setup mail class, recipients and body $mailer->AddAttachment('/home/mywebsite/public_html/file.zip', 'file.zip'); The AddAttachment function has four arguments: AddAttachment(PATH_TO_FILE, FILENAME, ENCODING, HEADER_TYPE) I used to use…
Karem
  • 17,615
  • 72
  • 178
  • 278
26
votes
4 answers

PHPMailer - SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Have encountered an issue where email should be sent from an mail server which has self signed certificate, the error which I get is : PHP Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error…
gor181
  • 1,988
  • 1
  • 14
  • 12
25
votes
1 answer

PHP Mailer with HTML template and sending variables

Basically I'm trying to do this. http://www.xeweb.net/2009/12/31/sending-emails-the-right-way-using-phpmailer-and-email-templates/ Here is my code index.php
user3350885
  • 739
  • 4
  • 16
  • 38
25
votes
21 answers

PHPMailer GoDaddy Server SMTP Connection Refused

The other day I was experiencing some problems with my GoDaddy hosted site. I called their tech support, and the person that I spoke with suggested that my problems were related to the fact that I was on a Windows box and would be better served on a…
AndroidDev
  • 20,466
  • 42
  • 148
  • 239
24
votes
3 answers

"Password not accepted from server: 535 Incorrect authentication data" when sending with GMail and phpMailer

I have the same php script running on localhost - my PC with XAMPP and on a hosted server. It works from my PC, but not from the hosted server. When I send it from the hosted server, I get the following output: SMTP -> ERROR: Password not accepted…
John Dorner
  • 1,085
  • 1
  • 8
  • 15
23
votes
2 answers

Send mail in phpmailer using DKIM Keys

Currents i am using phpmailer to send mail's. now how its possible to send email in phpmailer with DKIM keys i search in phpmailer Class file and i found the below code /** * DKIM selector. * @type string */ public…
Varun Sridharan
  • 1,983
  • 2
  • 20
  • 54