PHPmailer Authentication is set to False, but Authentication was still required - php

I am trying to send an Email to alert users of a file being imported.
In the PHP script, I have added "$mail->SMTPAuth=False", but I get the following error when trying to run the script: "SMTP ERROR: MAIL FROM command failed: 553 authentication is required"
If I run this script on a different machine, the SMTP error from above will not appear. I have tried and copied settings from the working machine, but on my own machine it still gives 553 error. I have ask the Email Server Admin regarding any special permission given to the working machine, but there was none. Are there any other settings I need to check?
Currently, I have matched all environmental variables and php's folder content from the working machine.

Credit to #Synchro
Turning off auth in your script will not work if the server requires it, and that's where the error is coming from. It could be requiring auth if you're not on its local network, which would explain the discrepancy between the two locations.

Related

EmailQueue not sending mail: "cannot find the path specified" in Windows

I am using the emailqueue by lorenzoherrera,
I have installed the setup in the windows 7 and executed the script and getting the error
The system cannot find the path specified
PHPMailer error : <strong> Could not execute : /var/qmail/bin/sendmail </strong>
This seems the linux path setting, what, how and where do I have to modify for windows setting, I am having no idea what to do.
Tough the db is showing the mail as send.
For it to even be looking at that path means it's being told to send via qmail, which you won't have on Windows. You need to alter the code that calls PHPMailer so that it's told to send either via a local mail server (using isMail()), or directly via SMTP using isSMTP(), along with appropriate login credentials. It sounds like this is a misconfiguration in EmailQueue, so I suggest you contact them for support - PHPMailer is only doing what it's told.

SMTP Error Issue - PHPMailer

I have a daily newsletter I send out to a list of people each day. I use PHP and the PHPMailer object to send the emails.
This has been working fine up until today when I didn't get an email (test) and I checked the logs to find that intermittently I was getting SMTP errors back from
mail->Send();
Method of the class on SOME of the people - not all of them.
All of the emails were exactly the same size (length in characters) apart from their name and email address.
The error details from
$mail->ErrorInfo;
Included these two errors
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
SMTP Error: Data not accepted.<p&gtSMTP server error: </p>
Why there are broken P tags in the error message I have no idea - also why the first error has OK in it??
However other people in the loop had emails go out fine.
Also when I put the script into test mode so ONLY these failures were emailed out (so one call of the script = one email to one person), I found no problem and the people got their emaail.
Now I asked tech support what the error meant and got back "Google it" and I can't find the error 2.1.5 OK anywhere. I don't really get why it says OK after an error either.
As a test for tomorrow I put a test in for a failed Send and then a Sleep for 5 seconds with a retry.
I don't know if this will help but I thought that maybe my SMTP server which is on the same server as my script (Rackspace VPS Linux) was having temporary issues connecting so a sleep might be handy in this situation.
This is the first time I have had this issue, I haven't rebooted APACHE or my server (or mailserver) and before this script I had another one send out 403 emails without any problem.
It would be nice to know what the error is and why it happened though.
Rob
That error is defined exactly where you would expect it to be - in the RFC that defines SMTP error codes. 2.1.5 means "Destination address valid". That it starts with a 2 means it's not an error as such, but a response code - warnings and errors start with 4 and 5. Why you got it, I don't know, but it certainly seems it was not expected in that context. Mail servers often have problems - they run out of disk space, get swamped by spam filtering, and this is why mail servers have queues. Sending directly using PHPMailer's SMTP class is not appropriate for high-volume sending - using SMTP is fine, but point it at a proper (nearby) MTA that can handle deliveries properly.
As for the garbled ErrorInfo content, I suspect you are using an old version of PHPMailer - the debug output has been cleaned up fairly recently. Another thing that changed lately is the handling of errors during single sends to multiple recipients (e.g. BCCs) - it's now much more likely to get to the end of a long recipient list without giving up than it was before.

Testing mail from php in OS X 10.10

Ever since OS X 10.8 I've used the steps here to test sending mail with php.
Basically it redirects php's sendmail_path to a .php script that saves the email message as a .emlx file and then opens Apple Mail (and that file) automatically.
This worked well until I upgraded to 10.10
After the upgrade to 10.10 all seems to work, the .emlx file is created as expected right where it is supposed to be but Apple Mail does not open up.
I'm getting the following error in my apache error_log
LSOpenURLsWithRole() failed with error -10810 for the file /Users/jason/smtp_out/2014-10-22_10.12.20_587.emlx.
I've got no clue about what LSOpenURLsWithRole() is all about. I'm guessing this is something around php not being able to open the .emlx file up in Apple Mail automatically (I can dbl click it and it opens in Mail as expected)
I've changed all the permissions as explained in the original site. Is there something I'm missing that would get the .emlx file to open automatically? (Does this need to be changed because of 10.10?)
UPDATE
As a temp fix, I've reverted to using a folder action but I'd still like to figure out what LSOpenURLsWithRole() failed with error -10810 is all about
I suggest to use Mailtrap instead. All you need to do is configure SMTP to use their server:
Host: mailtrap.io
Port: 25 or 465 or 2525
Username: your-username
Password: your-password
Auth: PLAIN, LOGIN and CRAM-MD5
TLS: Optional
All emails will be sent to Mailtrap regardless of the email address. You will then be able to access sent messages on mailtrap.io, you can view the message in HTML and text format, run an analysis on the message, etc.

Moodle New User Email Confirmation Error - Tried to send you an email but failed

Whenever a new user tries to create a new account, they get this message
Tried to send you an email but failed!
I tried setting up an email and using the smtp settings in Site
Administration -> Message output -> Email and that did not work.
I called my Host company (inmotion hosting) and they verified that my
settings were correct.
I tried just leaving the settings blank in email so that the phpmailer would send the emails, but that is not working and I still get the same message.
I have searched all overand I cannot find any helpful information on why this is happening,
but I find A LOT of people who are having this issue.
This has turned into a MAJOR show stopper and I am wondering what avenues I have to troubleshoot this. Does anyone have any information on how this is fixed?
Thanks in advance.
It might be missing a "from" email - have you got a support email set up?
/admin/settings.php?section=supportcontact
Or go to Site Administration > Server -> Support contact
I've had a similar issue. It works fine for the first three users created (in quick succession) but then fails for a few minutes. Enabling debugging (Site Admin -> Development -> Debugging page) showed that this was due to timeouts:
Debug info:
Error code: auth_emailnoemail
Stack trace:
line 463 of /lib/setuplib.php: moodle_exception thrown
line 106 of /auth/email/auth.php: call to print_error()
line 70 of /login/signup.php: call to auth_plugin_email->user_signup()
Output buffer: profile_field_PC<pre> SMTP -> ERROR: Failed to connect to server: Connection timed out (110)SMTP connect() failed. </pre>
This appears to be an anti-spam "feature" of the Amazon SES service we were using, which we will need to get around.
I know this is an old post but I will add my solution and give many thanks to Russell for that part of it.
This site had been moved over to Bluehost and come to discover that client did not set up an email account for Admin User - so in addition to checking that there is an email in the Admin settings, also verify that that email address exists and is reachable!

Windows SMTP Server with Server 2008 and PHP

For some reason the iis smtp server and php are not communicating properly. I have verified that the smtp is working by telneting to it and doing the mail commands and I'm able to receive an email. In addition, I followed this link http://support.microsoft.com/?id=297700 and was able to receive an email. But whenever I try to send email from PHP nothing happens. What makes this even crazier is there are no smtp logs being written. The log files should be located at c:\windows\system32\logfiles\smtpsvc1 but the smtpsvc1 folder does not exist and there are no email messages in the drop, pickup, queue, or badmail folders under mailroot.
I'm not really sure why no logs exist for this. I gave the Network Service user permission to that logfiles folder but to no avail. So I guess the gist of my question is how can I make PHP and iis smtp send email.
I have the smtp configured to send email to a remote MailEnable server not exchange. Any ideas?
Not really a direct answer, but you know that by default SMTP logging is not on and you need to enable it via IIS manager. So, you won't get any logs until you do so. You will be able to tell if logging is enabled, as SMTP startup/initialization will generate log entries, regardless to any other activities. If your log file is blank, SMTP is not running.
That test only applies to 2000, at least that what the papers says.
You should try here

Categories