PHP Classes

How to Use a PHP 2FA Email to Send Email Messages Via Gmail with Greater Security Using the Package PHP 2FA: Send messages using Gmail 2 Factor Authentication

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-11-08 (1 month ago) RSS 2.0 feedNot enough user ratingsTotal: 45 This week: 1All time: 10,806 This week: 42Up
Version License PHP version Categories
php_2fa 1.0.0MIT/X Consortium ...5Email, PHP 5, Security
Description 

Author

This package can send messages using Gmail Two Factor Authentication.

It can take a configuration array created by Google that takes the SMTP host address, port, encryption method, user name, and application-specific password tied to a given user.

The package uses the PHPMailer class to send an email message with a given subject, recipient email address, and a text message.

Innovation Award
PHP Programming Innovation award nominee
November 2024
Nominee
Vote
Many users send email messages via Gmail. Websites can also use Gmail to send email messages to their users using the Gmail SMTP server.

Over time Google increased the requirements from developers that use Gmail to send email messages via SMTP to use more secure methods.

Gmail supports two-factor authentication methods for sending messages via their SMTP server.

This package shows how to configure SMTP email deliveries using Gmail in a way that is compliant with Google two two-factor authentication methods.

Manuel Lemos
Picture of Rodrigo Faustino
  Performance   Level  
Name: Rodrigo Faustino <contact>
Classes: 33 packages by
Country: Brazil Brazil
Age: 41
All time rank: 2386163 in Brazil Brazil
Week rank: 1 Up
Innovation award
Innovation award
Nominee: 21x

Winner: 2x

Example

<?php
require '../vendor/autoload.php';

use
App\Services\EmailService;

$emailService = new EmailService();
$emailService->sendEmail('rodrigohipnose@gmail.com', 'Teste de E-mail', 'Este é um e-mail de teste.');


  Files folder image Files (5)  
File Role Description
Files folder imagesrc (1 file, 2 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data

  Files folder image Files (5)  /  src  
File Role Description
Files folder imageconfig (1 file)
Files folder imageServices (1 file)
  Accessible without login Plain text file envia_email.php Example Example script

  Files folder image Files (5)  /  src  /  config  
File Role Description
  Accessible without login Plain text file config.php Aux. Configuration script

  Files folder image Files (5)  /  src  /  Services  
File Role Description
  Plain text file EmailService.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:45
This week:1
All time:10,806
This week:42Up