Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteiTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
The dependable setup for a PHP application on Linux, Apache, MySQL and PHP (LAMP) is PHPMailer using Microsoft 365 client SMTP submission: connect to smtp.office365.com on port 587, negotiate STARTTLS, and authenticate with Microsoft Entra OAuth2/XOAUTH2. The sending mailbox must be licensed, SMTP AUTH must be permitted, and the server must support TLS 1.2 or 1.3 with outbound port 587 open.
What you need before writing PHP code
Microsoft 365 offers several ways for an application to send mail. For a normal PHP web application that sends to both internal and external recipients, client SMTP submission is the practical default. It authenticates a mailbox, uses TLS, and records submitted messages in that mailbox’s Sent Items.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →A licensed Microsoft 365 mailbox
Client SMTP submission requires a licensed Microsoft 365 or Office 365 mailbox. Create or select a mailbox dedicated to the application rather than using a personal administrator account. You will need its complete sign-in address, such as an address at your organization’s domain, and permission to use it for SMTP submission.
SMTP AUTH and tenant policy
SMTP AUTH is disabled by default for organizations created after January 2020, according to Microsoft’s current guidance, and it can also be disabled by a tenant-wide policy or by the individual mailbox. Check both levels before troubleshooting PHP. Microsoft recommends Modern Authentication (OAuth) instead of password-only Basic authentication. Basic authentication is incompatible with Microsoft Entra Security Defaults.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.
Enable SMTP AUTH only for the mailbox that needs it, and follow your organization’s conditional-access and security policies. Enabling the protocol does not by itself grant permission to send as every address in the tenant.
A LAMP host that can make a TLS connection
- DNS on the host must resolve
smtp.office365.com; use the DNS name, not an IP address. - Outbound TCP port
587should be allowed by the Linux firewall, cloud security group and hosting provider. Port25is also documented for submission, but port 587 is the recommended choice. - PHP must have the OpenSSL extension enabled and be able to negotiate TLS 1.2 or TLS 1.3.
- Apache’s PHP process must be able to read the Composer-installed libraries and the environment variables that hold OAuth credentials.
On a Debian- or Ubuntu-style server, check the PHP modules and Composer installation with commands appropriate to your distribution:
php -m | grep -i openssl
php -v
composer --version
If openssl is absent, install the OpenSSL support package for the PHP version used by Apache, restart Apache, and repeat the module check. Do not assume the command-line PHP binary and Apache’s PHP module use the same configuration; verify both when a command-line test works but the web application does not.
Install PHPMailer with Composer
PHP’s built-in mail() function normally hands a message to a local mail server, commonly through a sendmail binary on Linux, BSD or macOS. A LAMP server may not have a local MTA configured, and that local path does not provide the Microsoft 365 SMTP, TLS and OAuth controls needed here. PHPMailer supplies the SMTP transport and supports XOAUTH2.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
From the application directory, install the maintained package with Composer:
composer require phpmailer/phpmailer
Load Composer’s autoloader in the PHP entry point. Keep the vendor directory deployed with the application or run Composer during deployment; do not copy a random library file into the web root.
The Microsoft 365 SMTP settings
| Setting | Value for client SMTP submission | Why it matters |
|---|---|---|
| SMTP host | smtp.office365.com |
Use Microsoft’s DNS name, never a hard-coded IP address. |
| Port | 587 (recommended) or 25 |
The selected port must be unblocked for outbound traffic. |
| Encryption | STARTTLS | The connection begins unencrypted and is upgraded to TLS before authentication. |
| TLS versions | TLS 1.2 or TLS 1.3 | The operating system, OpenSSL and PHP must support one of these versions. |
| Authentication | Microsoft Entra OAuth2/XOAUTH2 | Modern authentication is preferred for current tenants. |
| Mailbox | Licensed Microsoft 365 mailbox | Client submission authenticates a mailbox identity. |
| From address | Normally the authenticated mailbox | A different sender requires explicit Send As permission. |
Configure PHPMailer for STARTTLS
The transport portion is the same whether the credential is a temporary password during a controlled test or an OAuth token in production. The following code establishes the connection and uses OAuth2; the provider object must be configured for your Microsoft Entra application as described in the next section.
<?php
declare(strict_types=1);
use PHPMailerPHPMailerException;
use PHPMailerPHPMailerOAuth;
use PHPMailerPHPMailerPHPMailer;
require __DIR__ . '/vendor/autoload.php';
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
$mail->Host = 'smtp.office365.com';
$mail->Port = 587;
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->SMTPAuth = true;
$mail->AuthType = 'XOAUTH2';
// $provider is the Microsoft Entra OAuth provider created for this tenant.
$mail->setOAuth(new OAuth([
'provider' => $provider,
'clientId' => getenv('OAUTH_CLIENT_ID'),
'clientSecret' => getenv('OAUTH_CLIENT_SECRET'),
'refreshToken' => getenv('OAUTH_REFRESH_TOKEN'),
'userName' => getenv('M365_SMTP_USERNAME'),
]));
$mail->setFrom(getenv('M365_SMTP_USERNAME'));
$mail->addAddress('recipient@example.net');
$mail->Subject = 'Application message';
$mail->Body = 'This message was sent through Microsoft 365 SMTP submission.';
$mail->AltBody = 'This message was sent through Microsoft 365 SMTP submission.';
$mail->send();
} catch (Exception $e) {
error_log('Mail send failed: ' . $mail->ErrorInfo);
}
The OAuth provider must request the SMTP permission scope https://outlook.office.com/SMTP.Send. Request the refresh capability required by your token flow so the application can obtain new access tokens without storing a user password. PHPMailer’s official Azure example follows this pattern: configure a provider, set the client ID, secret, refresh token and username, select XOAUTH2, and call setOAuth().
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
Use environment variables or a secret manager for client secrets and refresh tokens. Never commit them to Git, place them in a publicly served configuration file, or print them in an exception page.
Register the application and obtain an OAuth token
- Register an application in Microsoft Entra. Record the application (client) ID and create a credential using your organization’s approved secret or certificate policy.
- Grant SMTP permission. Add the delegated or application permission required by your chosen flow for
https://outlook.office.com/SMTP.Send, then grant tenant consent when your organization requires administrator approval. - Complete the sign-in and consent flow. Obtain an authorization code or use the approved service-account flow, then exchange it for an access token and refresh token as applicable. The token’s audience and scope must be valid for Outlook SMTP.
- Give PHPMailer the token provider. Build the OAuth provider with the tenant’s Microsoft identity endpoints and pass it, along with the client credentials, refresh token and mailbox username, to
setOAuth(). - Match the sender. Set
Fromto the OAuth user while validating the connection. Change it only after Send As permission has been granted and tested.
Token acquisition is separate from the SMTP connection: an access token can be valid while the mailbox is prohibited from SMTP AUTH, and SMTP AUTH can be enabled while a token lacks the SMTP.Send permission. Check both when authentication fails.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Build and send a complete message
After the connection settings and authentication are correct, construct the message with a clear sender, recipient and content. PHPMailer handles MIME formatting, but your application still needs input validation and output encoding for user-supplied data.
$mail->clearAddresses();
$mail->addAddress($validatedRecipient);
$mail->isHTML(true);
$mail->Subject = $validatedSubject;
$mail->Body = $safeHtmlBody;
$mail->AltBody = $plainTextBody;
$mail->send();
- Validate recipient addresses before passing them to
addAddress(). - Escape untrusted text inserted into HTML mail; do not concatenate raw form input into HTML.
- Always provide
AltBodyfor clients that do not render HTML. - Do not use a user-controlled address as the envelope sender or
Fromheader. Use a mailbox you control and place the user’s address inReply-Toafter validation.
Sender identity and Send As permission
Microsoft 365 generally expects the From address to match the mailbox that authenticated with OAuth. If the application authenticates as mailer@example.com but sends as billing@example.com, an administrator must grant the authenticating account Send As permission on the other mailbox.
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
Without that permission, Microsoft documents the nondelivery report text: “5.7.60 SMTP; Client doesn’t have permissions to send as this sender.” Granting permission can take time to propagate. Retest with the exact address in the From header after the change; changing only the display name does not change authorization.
Choose the right Microsoft 365 delivery method
Client SMTP submission is not the only option. Select a different method when the application’s volume, recipient scope or infrastructure does not fit mailbox authentication.
Free tools Windows power users keep installed
One-click scans. No signup required.
| Method | Authentication and endpoint | Recipient scope | When it fits | Important constraints |
|---|---|---|---|---|
| Client SMTP submission | Mailbox authentication; smtp.office365.com on port 587 or 25 with TLS |
Internal and external recipients | Most PHP web applications sending normal transactional or user-triggered messages | Licensed mailbox, SMTP AUTH and mailbox submission limits apply; messages are saved to Sent Items. |
| SMTP relay | Tenant MX endpoint on port 25 with TLS; connector trusts a certificate or static public IP | Internal and external recipients | A controlled server needs relay and mailbox submission limits are insufficient | Requires connector administration and a static, unshared IP or certificate; a licensed mailbox is not required. |
| Direct Send | Tenant MX endpoint on port 25; no licensed mailbox | Microsoft 365 recipients only | Restricted internal-recipient scenarios | Unsuitable for Internet-facing transactional mail. |
| High Volume Email | Microsoft service intended for high-volume internal workloads | Primarily internal workloads | Internal volume exceeds ordinary mailbox submission needs | Availability and quotas depend on tenant and region. |
| Azure Communication Services Email | Separate Microsoft cloud email service | Internal and external recipients | External delivery is required but client SMTP submission is inappropriate | Availability, pricing and quotas depend on tenant and region. |
For client SMTP submission, Microsoft’s current published limits are 10,000 recipients per day and 30 messages per minute. Treat these as service limits, not a throughput target; queue work, handle transient failures and monitor usage. If your workload regularly approaches either limit, evaluate relay or an approved high-volume service before production traffic is affected.
Security and production deployment checklist
- Store the client secret, refresh token and mailbox password, if one is temporarily used, outside the repository and outside the document root.
- Restrict file permissions so only the Apache/PHP service account and deployment personnel can read runtime secrets.
- Use HTTPS for the application’s own login and token callback endpoints.
- Keep PHPMailer and its dependencies updated through Composer and review lock-file changes during deployment.
- Use a dedicated mailbox with the minimum permissions required. Do not grant broad Send As rights when the application only needs its own address.
- Disable PHPMailer debug output after diagnosis. SMTP transcripts can contain addresses, server responses and authentication material.
- Redact tokens, authorization codes and secrets from application logs, error pages and support bundles.
- Queue email jobs rather than making a visitor wait for a slow SMTP transaction. Record a message ID or internal job ID so failures can be retried safely without sending duplicates.
Troubleshoot the connection in the order it fails
1. DNS or network failure
Confirm that the LAMP host resolves smtp.office365.com and that outbound TCP 587 is permitted. A timeout usually indicates a firewall, security group or hosting-provider restriction, not an OAuth problem. If port 587 is blocked, ask the provider to allow it; do not silently switch to an unrelated IP address.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
2. TLS negotiation failure
Check that the PHP process has OpenSSL support and that the host’s OpenSSL library can negotiate TLS 1.2 or TLS 1.3. STARTTLS must be enabled; configuring implicit SSL on the STARTTLS port causes a protocol mismatch. Verify the PHP configuration used by Apache rather than relying only on a command-line test.
3. Authentication rejected
Confirm the mailbox username, tenant policy and per-mailbox SMTP AUTH setting. If the tenant uses Security Defaults, password-only Basic authentication will not work; use OAuth2. For OAuth, verify the token’s SMTP.Send scope, tenant consent, refresh-token validity and the username supplied to PHPMailer.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →4. Sender rejected
Set the From address to the authenticated mailbox. If a different mailbox is required, obtain Send As permission and wait for it to propagate. The documented 5.7.60 error specifically indicates that the authenticated client lacks permission to send as the selected sender.
5. Message accepted but not delivered
Inspect the application’s result and Microsoft 365 message-trace tools, then check recipient spelling, spam filtering and domain authentication. Microsoft recommends SPF, DKIM and DMARC for domain protection, particularly when using relay or Direct Send. Do not treat an SMTP success response as proof that the recipient’s mailbox accepted the message.
6. Debug safely
Temporarily enable PHPMailer’s server debugging while reproducing one failure, capture only the relevant SMTP status and TLS stage, and then turn debugging off. Never publish the transcript or leave it enabled in production; redact credentials and tokens before sharing any diagnostic output.
Operational limits and retry behavior
Microsoft’s client-submission limits—10,000 recipients per day and 30 messages per minute—are measured service constraints. Count recipients, not just application requests, because one message with multiple recipients consumes multiple recipient units. Implement a queue with bounded retries and exponential backoff for temporary failures. Permanently rejected addresses should be removed or suppressed rather than retried indefinitely.
Keep a record of the application’s message identifier, recipient, attempt count and final SMTP response. This makes it possible to distinguish a network timeout, where delivery may be uncertain, from a definitive policy rejection. Idempotency protection is important when a worker retries after losing the connection immediately after the server accepted a message.
Quick Recap
Why common shortcuts fail
- Using
mail()alone: it normally targets a local sendmail-compatible service and does not configure Microsoft 365’s host, STARTTLS or OAuth flow. - Using port 465 with the STARTTLS setting: port 465 is an implicit-TLS pattern, while the documented client-submission configuration uses STARTTLS on port 587 (or 25).
- Hard-coding an SMTP IP: Microsoft requires the DNS name
smtp.office365.com; service IPs can change and certificate validation will not match an arbitrary address. - Putting a mailbox password in source code: current tenants may block Basic authentication, and exposed credentials create a wider compromise than a scoped OAuth credential.
- Changing only the display name to solve a sender error: authorization applies to the actual address in the
Fromheader, not the friendly name. - Assuming a licensed mailbox removes all limits: licensing enables client submission but does not remove the published recipient and message-rate limits.
A concise validation run
- From the LAMP host, verify DNS resolution and outbound TCP 587.
- Confirm OpenSSL, TLS 1.2 or 1.3 and Composer are available to the Apache PHP runtime.
- Install PHPMailer with Composer and deploy its autoloader.
- Register the Entra application, grant the SMTP.Send permission and obtain a refresh-capable token for the sending mailbox.
- Enable SMTP AUTH for that mailbox if tenant policy permits it.
- Run a one-recipient test using
smtp.office365.com, port 587, STARTTLS, XOAUTH2 and a matchingFromaddress. - After acceptance, check Sent Items and the recipient mailbox, then disable debug logging and move the test into the application’s queue and monitoring path.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

