Test an email without 'Less Secure App Access' |
Im trying to send an email through the CodeIgniter backend. Many suggest using Gmail SMTP server, but Im concerned about enabling 'Less Secure App Access' which I'd prefer to avoid. Is there an easy way to test email sending without having to use that feature?
You can also use your internet providers SMTP server and send them to yourself.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Totally understand your concern about "Less Secure App Access". Here are a few options to test email sending in CodeIgniter without enabling it:
1. Local Testing with Fake SMTP Server: Use a library like "PHPMailer" with a local fake SMTP server like "MailCatcher" or "FakeSMTP". This simulates sending emails without actually sending them anywhere. Great for initial testing and development. 2. Use a Dedicated SMTP Service: Consider signing up for a free or paid service like SendGrid, Mailgun, or Amazon SES. They offer secure SMTP access without needing "Less Secure App Access". They usually have simple integrations for CodeIgniter too. 3. Implement Email Templates (No Sending): Focus on building well-formatted email templates in your CodeIgniter backend without attempting to send them. This tests the content and structure without involving external servers. 4. Test with a Different Email Provider: If you have another email provider (e.g., Yahoo, Outlook), check if they offer SMTP access without requiring similar security compromises. Test cautiously with a dedicated email address for this purpose. Remember, using "Less Secure App Access" isn't ideal, and these alternatives let you test and develop your email functionality safely and securely. Good luck!
This is not easy, but if you want to use Gmail, you can use PHPMailer and XOAuth2 SMTP authentication.
See https://github.com/PHPMailer/PHPMailer/w...API-Client
If your running on Windows you can use this tool, I have used it for years for testing emails.
ToolHeap - Test Mail Server Tool What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
If you use Docker, devkit provides MailHog:
See https://github.com/codeigniter4/devkit/t...er#mailhog
I suggest using the Mailtrap mail server. It's quite user-friendly. Here are CodeIgniter code snippets which connect to the server and send simple text mail.
Code: <?php |
Welcome Guest, Not a member yet? Register Sign In |