{"id":29091645,"url":"https://github.com/mathsgod/phpmailer-gmail","last_synced_at":"2025-06-28T06:41:28.929Z","repository":{"id":295781038,"uuid":"991236285","full_name":"mathsgod/phpmailer-gmail","owner":"mathsgod","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-27T10:38:38.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-27T11:15:14.685Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathsgod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-27T10:26:08.000Z","updated_at":"2025-05-27T10:38:00.000Z","dependencies_parsed_at":"2025-06-02T21:01:05.239Z","dependency_job_id":null,"html_url":"https://github.com/mathsgod/phpmailer-gmail","commit_stats":null,"previous_names":["mathsgod/phpmailer-gmail"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mathsgod/phpmailer-gmail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fphpmailer-gmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fphpmailer-gmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fphpmailer-gmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fphpmailer-gmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathsgod","download_url":"https://codeload.github.com/mathsgod/phpmailer-gmail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fphpmailer-gmail/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262388753,"owners_count":23303322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-28T06:41:21.007Z","updated_at":"2025-06-28T06:41:28.917Z","avatar_url":"https://github.com/mathsgod.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GmailMailer for PHPMailer \n\nThis project provides a `GmailMailer` class for sending emails via Gmail SMTP using PHPMailer and OAuth2 authentication.\n\n## Features\n\n- Send emails through Gmail SMTP securely\n- Uses OAuth2 (no need for less secure app access)\n- Simple integration with your PHP projects\n\n## Installation\n\n1. Clone or download this repository.\n2. Install dependencies using Composer:\n\n   ```bash\n   composer install\n   ```\n\n## Usage\n\n1. Obtain your Gmail address, Google OAuth2 client ID, client secret, and refresh token.\n2. Use the `GmailMailer` class in your PHP script:\n\n   ```php\n   require 'vendor/autoload.php';\n   use PHPMailer\\GmailMailer;\n\n   $gmail = 'your-email@gmail.com';\n   $clientId = 'YOUR_GOOGLE_CLIENT_ID';\n   $clientSecret = 'YOUR_GOOGLE_CLIENT_SECRET';\n   $refreshToken = 'YOUR_REFRESH_TOKEN';\n\n   $mailer = new GmailMailer(true, $gmail, $clientId, $clientSecret, $refreshToken);\n   $mailer-\u003eaddAddress('recipient@example.com');\n   $mailer-\u003eSubject = 'Test Email';\n   $mailer-\u003eBody = 'This is a test email sent via Gmail SMTP with OAuth2.';\n\n   if ($mailer-\u003esend()) {\n       echo \"Message sent!\";\n   } else {\n       echo \"Mailer Error: \" . $mailer-\u003eErrorInfo;\n   }\n   ```\n\n## How to Get OAuth2 Credentials\n\nFor detailed instructions on obtaining OAuth2 credentials and generating a refresh token, please refer to the [thephpleague/oauth2-google GitHub repository](https://github.com/thephpleague/oauth2-google).\n\n## License\n\nMIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Fphpmailer-gmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathsgod%2Fphpmailer-gmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Fphpmailer-gmail/lists"}