PHPMailer – SMTP error password command failed

phpmailer smtp gmail

Hey guys, i have been experimenting with smtp and gmail for sending to clients using php. Found this wonderful article and thought of saving it here on my blog as a keepsafe. Unfortunately, bobcares does like his blogs to be posted anywhere else. Such a shame.

Anyways, hope you enjoyed the research. It helped me through mine.

Leave some comments blow.

Coffee Cup

phpmailer-smtp-error-password-command-failed

Stuck with PHPMailer – SMTP error password command failed? We can help you.

We may come across this error when we try to send mail using phpmailer().

SMTP ERROR: Password command failed: 534-5.7.14

As part of our Server Management Services, we assist our customers with several SMTP queries.

Today, let us see how to fix this error.

PHPMailer – SMTP error password command failed

This error may occur due to the below reasons:

  • When a less secure application tries to use the email account.
  • If we try to log in several times a row
  • If we change countries (For example, use VPN, move code to a different server, or actually try to login from a different part of the world).

Moving ahead, let us see the methods our Support Techs employ in order to fix this.

Solution 1: In the case of the Windows server

PHP.ini

  1. Initially, we go to C:\xampp\php, edit the php.ini file with notepad.
  2. Under the [mail munction] section, we remove the semicolon for this line:sendmail_path = “\”C:\xampp\sendmail\sendmail.exe\” -t”
  3. Then we add a semicolon for this line:sendmail_path=”C:\xampp\mailtodisk\mailtodisk.exe”

SendMail.ini

  1. Here, we go to C:\xampp\sendmail, edit the sendmail.ini file with notepad
  2. Then we change the following:smtp_server=smtp.gmail.com smtp_port=465 [email protected] auth_password=your-gmail-password [email protected]

smtp_port should tally with what is written in our php code.

Solution 2: Enable less secure applications (SMTP server is Gmail)

  1. Initially, we login to the account via web
  2. Then we view recent attempts to use the account and accept suspicious access:
    https://security.google.com/settings/security/activity?hl=en&pli=1
  3. We can disable the feature of blocking suspicious apps/technologies:
    https://www.google.com/settings/u/1/security/lesssecureapps

Solution 3: (SMTP server is Gmail)

  1. Initially, login to the account via web
  2. Access the URL: https://accounts.google.com/b/0/DisplayUnlockCaptcha
  3. Then we click the continue option
  4. We can check whether phpmailer is set as SMTP with SSL.

This will work if our SMTP server is Gmail.

Solution 4: Change SMTPSecure value from SSL to TLS in phpmailer() code.

Solution 5: In the case of Gsuite

In such a case, we have to solve it as the Administrator.

  1. Go to Admin panel >> Security with Shield icon >> Basic settings
  2. Then go to the Less secure apps section
  3. Now we select one of the Radio Button:

a) Disable access to less secure apps for all users (Recommended)
b) Allow users to manage their access to less secure apps
c) Enforce access to less secure apps for all users (Not Recommended)

Generally, if option a) does not work, it will start to work with the c) option.

Solution 6: In the case of cPanel/WHM servers

This is related to a security feature in WHM/cPanel.

  1. Firstly, log in to CPanel
  2. Navigate to Tweak Settings > All > “Restrict outgoing SMTP to root, Exim, and mailman
  3. Eventually, switch it from “On” to “Off”.

In addition, we can do this via SSH as well:

/scripts/smtpmailgidonly off

GFIX — Firebird Administration

GFIX is Firebird’s command line tool for administration issues like data repair, sweeping, etc.

General Syntax

gfix [options] -user <username> -password <password> <database> [options]
 
-user <username>Database user name
-pas[sword] <password>Database password
-fet[ch_password] <filename>Instead of -password: Fetch password from the file so it is not visible in the command line. When <filename> is stdin, the user will be prompted for the password. [Firebird 2.5]

Database Shutdown

When a database has been shut down, only SYSDBA and the database owner are able to connect to the database in order to perform administrative tasks.

Options

-at[tach] <seconds>Used with the -shut option. Waits <seconds> seconds for all current connections to end. If after <seconds> seconds there are still connections open, the shutdown will be cancelled and return an error.
-f[orce] <seconds>Used with the -shut option. Waits <seconds> seconds for all connections and transactions to end. After this time, all connections and transactions are cancelled and the database is shut down. Use with caution.
-o[nline]If a -shut operation is pending, it is cancelled. Otherwise, takes a database back online
-sh[ut]Shut down database. Must be used together with -attach, -force or -tran
-shut {normal | multi | single | full}-online {normal | multi | single | full} Firebird 2.0 and later: New shutdown modes:NORMAL: Database is active and online
MULTI: Only connection from SYSDBA and the Database Owner will be allowed (compatible mode with Firebird 1.0/1.5)
SINGLE: Only one SYSDBA or Database Owner connection will be allowed
FULL: Exclusive shutdown: Database is completely offline, no connections will be allowed (it is now possible to access the database file safely on a file basis, e.g. for backups)Use -shut to “go down” the scale of shutting down and -online to “go up” that scale.
-tr[an] <seconds>Used with the -shut option. Waits <seconds> seconds for all running transactions to end. If after <seconds> seconds there are still running transactions, the shutdown will be cancelled.

Examples

Shut down database, wait 60 seconds until all connections are closed

gfix -user SYSDBA -password "masterkey" dbserver:/db/mydb.fdb -shut -attach 60

Note that GFIX will terminate with an error if there are still connections open after 60 seconds.

Shut down database, force shutdown after 60 seconds

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -shut -force 60

Shut down database, force shutdown NOW

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -shut -force 0

Put database online again

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -online

Examples for Firebird 2.0

Shut down database to single user mode

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -shut single -force 60

Put database online again

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -online normal

Shut down database, force shutdown NOW, allow no subsequent connections, even from SYSDBA or Owner

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -shut full -force 0

Database Repair, Sweeping

Options

-f[ull]Use with the -v option. Checks all records and pages and releases unassigned record fragments
-h[ousekeeping] 0Switch off automatic sweeping
-h[ousekeeping] <n>Set Sweep Interval to <n> transactions (default is 20000)
-i[gnore]Ignores checksum errors during a validate or sweep
-m[end]Marks corrupt records as unavailable so they are skipped on a subsequent backup
-n[o_update]Use with the -v option. Checks all records and pages and reports errors but does not repair them
-sweepForces an immediate sweep
-v[alidate]Check database for validity. At the same time, errors are reported and repaired

Examples

Validate Database

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -v -f

Sweep Database now

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -sweep

Set Sweep Interval to 50000 transactions

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -h 50000

Switch off Automatic Sweeping

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -h 0

Misc

Options

-a[ctivate]Activate Shadow file for database usage
-b[uffers] <pages>Default cache buffers for the database will be set to <pages> pages
-c[ommit] <id>Commits limbo transaction specified by the given <id>
-c[ommit] allCommits all limbo transactions
-l[ist]Display IDs of all limbo transactions and what would happen to each transaction if you would use -t on it
-mo[de] read_writeSet mode of database to read/write (default). Requires exclusive access to database (shutdown)
-mo[de] read_onlySet mode of database to read-only. Requires exclusive access to database (shutdown)
-pa[ssword] <password>Database password
-p[rompt]Use with -l. Prompts for action.
-r[ollback] <id>Rolls back limbo transaction specified by the given <id>
-r[ollback] allRolls back all limbo transactions
-s[ql_dialect] 1Sets SQL dialect 1 for the database
-s[ql_dialect] 3Sets SQL dialect 3 for the database
-t[wo_phase] <id>Performs automated two-phase recovery for limbo transaction with the given <id>
-t[wo_phase] allPerforms automated two-phase recovery for all limbo transactions
-user <name>Database username
-w[rite] syncEnables Forced Writes
-w[rite] asyncDisabled Forced Writes
-zShow GFIX and server version

Examples

Set Database to Read-Only

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -shut -attach 60
gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -shut -force 0
gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -mode read_only
gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -online

Set Database to SQL Dialect 3

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -sql_dialect 3

Enable Forced Writes

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -write sync

Disable Forced Writes

gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -write async

http://www.destructor.de/firebird/gfix.htm

Business Models Ideas (20210914)

Business Ideas
  • Consulting – price / events / value of knowledge
  • Blogger – collaboration / click per view / online courses
  • Property Management – shove snow / mow loan / doing maintenance / show apartments / get landlord / collect cash
  • Drop shipping – no handling fees / marketing / advertising / list amazon / eBay / manufacturer / send to customer / sell using own brand / online store / market place / Lazada and Shopee
  • Affiliate Marketing – indirect influencer / niche / affiliate / click bait / amazon / follow link / blog or social media / talk makeup put links / clink juncsion
  • Errand / Services – grocery / chores / dry cleaning / super assistant to busy boss / DTI / payroll
  • Online Printing – printed on t-shirt / affordable designer / ambassador / seasonal trend / Feb. lover t-shirt
  • Interior Design – design for clients / consultation
  • Photography – stock photos / decent camera
  • Advertising – newspaper commercials / book or website / put qr code / google ads / seo
  • Free Premium – model certain features are free and certain features are not. Gmail storage limit / WordPress platform with add-in template and plug-ins
  • Subscription – Milkman deliver milk and take the money. Recipe / Nike sign0up / Coffee patrons
  • Transaction – give service / give money

Property Ideas (20210213)

Property Notes

These are suggestions on how to expand and business ideas

Business – bakery , tricycle , egg dealer , barber , coffee , restaurant , fish ball , automotive , organic farming , Korean food , inihaw manok, refilling station

Salary of the people – lifestyle – hobbies – past time

Land – farming , motorcycle terminal, aquaponics, animal farming, tour guides, prepare to stay, scenic spots , food carts , commissary , fiesta , seasonal food (dragon fruit / sili), solar panel, water generation, sell online, prepack food , pigfeed , cooked food

Market – resto, hotels, hospitals, barangay fiesta, party, palengke , weddings , office , carinderya.

7R Theory by Dhaval Bathia

7R Theory

To earn money we have 7 options starting with R. When i first heard this one I was amazed on how simple it is. A lesson worth hearing him in person on Youtube

  1. RATE – This pertains to the selling price of items.
  2. RENUMERATION – This refers to profession such as doctor or lawyer
  3. REPLICATION – Refers to man and machine or automation. the lesser the workforce, the more money the business can save
  4. RENT – This refers to rental income or property appreciation.
  5. ROYALTY – This refers to a product from your talent. It may be a game such as Candy Crush, or a YouTube video and blog
  6. RIGHTS – This refers to franchises, brand and logo
  7. RETURNS – This refers to stock market, gold or silver , properties , interest , dividends and appreciation

7 Truths to become rich. Richest man in Babylon (20201120)

Truths of becoming rich

These are tried and tested rules for the rich and those who want to become one. All of these rules we need to keep near our financial wallets in order to survive. There they are

  1. Start your purpose for wallet fattening – Save 10% from 100% income. So far this is the hardest part and we start with this one. A famous rich person once said, it’s either you increase your income or you shrink to your income.
  2. Control thy expenditures – Budgets are good in these situations. We need to sacrifice today, for our financial situation to improve in the future.
  3. Put each coin to labor – This means to have investments in things that produce more money. A simple example of this is the bank account. But nowadays, people invest in digital investments that give 2% to 3% interest.
  4. Guard thy treasure from loss – The people we lend money must have the power to repay it back. We need security to the risk. We can do this by issuing a collateral.
  5. Make thy dwelling a profitable investment – If you buy a house, make sure you do not overpay for it. As a rule of thumb, you need to provide security and make wifey happy.
  6. Ensure a future income – We also need to plan for the future. Invest or become a money lender. That is called leverage. It can also give protection to the family.
  7. Increase they ability to learn – Cultivate skills and build confidence in yourself. Learn from the masters you want to reach.

Real Estate Income Tips (20201221)

Rental Estate Tips

For those who want to enter the real estate market, I have a few ideas on what to do with it.

  • Townhouses for rent to friends , family and officemates
  • Condo units register it as Air-Bnb
  • Foreclosed properties as flipping
  • Empty lots good for planting , parking and mini stalls
  • Family home with multiple doors for rental income

Things to look out for

  • Titles and down payments. You might need to hire a lawyer
  • Rental price vs competition
  • Loan rates for personal or corporate
  • Tenant contract for house rules
  • Cash flow. Need to know the profit per year and per door
  • Unit profile. Need to know the square foot, when it was made, and how many it has changed hands
  • Debt on the deal. If it is still being paid in the bank and how much interest it is on.
  • Repair cost. This is for carpets, paint, fence, layout
  • Property manager. It can also be a broker who will take care of the property
  • Location. Crime rates, what stores are around, businesses and schools, if there are street lights
  • Banks loan rates, what is the last trade price

Win10 Cannot Connect to Shared Printer

Recently i encountered a problem that doesn’t allow me to add a shared printer. It seems to be new so it might have something to do with the windows update.

Then i found the solutions. Its to add a registry entry. here it is :

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\RpcAuthnLevelPrivacyEnabled to 0

Once you do this you can now continue.

Enjoy,

Coffee Cup

Why is my hard disk empty? Working on Microsoft SQL Server project

Recently I have download Microsoft SQL Server for a small interesting project I was working. Then all of a sudden, my hard disk space became 0 in my Drive C.

Puzzled for a few days a encountered a blog post that featured a nifty little software that I will now keep in my software belt.

It shows you the disk size of each folder in your pc. Quite a good find. The name of the software is TreeSize Free version.

For the culprit, the folder is located at :

C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log\Polybase\dump

When I looked at the folder, it came to 91gb.

So just in case you are working on a project in Microsoft SQL Server, be sure that the hard disk space will be close to zero, unless you can clean the dump folder.

Hope it helps

Stay safe guys

Coffee Cup

SB Admin PHP – Fixed Table Header with Scrollable Body

Hi guys,

This question was raised to me recently and it peeked my interest to solve and find out how to do this. After digging around i found 2 working codes for my case.

To explain further my tables are generated dynamically so the column widths and gaps differ by each refresh of the table

There are the 2 options that i found

////////////// OPTION 1 //////////////////////
table tbody { display:block; max-height:450px; overflow-y:scroll; }
table thead, table tbody tr { display:table; width:100%; table-layout:fixed; }

table width=”100%” class=”table table-striped table-hover” id=”dataTables-example”
////////////// OPTION 2 //////////////////////
table {
overflow-y: auto;
height: 10vh;
}
thead th {
position: sticky;
top: 0;
}

table width=”100%” class=”table table-striped table-hover” id=”dataTables-example”

Hope this code helps out somebody out there. If you have any questions, just drop me a line.

Coffee Cup