http://qs1969.pair.com?node_id=11120649

Arik123 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, monks!

I wrote an application that uses Gmail (IMAP and SMTP), using modules I found on CPAN (Email::Send::SMTP::Gmail and Net::IMAP::Simple::SSL). It works... only that Gmail complains that my application is insecure, and wants me to configure my account to allow access for insecure applications.

Is it possible wo access Gmail in a way it'll be happy? to write a secure application in Perl?

Thank you very much!

  • Comment on Using Gmail - making my application secure

Replies are listed 'Best First'.
Re: Using Gmail - making my application secure
by Corion (Patriarch) on Aug 12, 2020 at 11:46 UTC

    Google calls all applications "insecure" that don't use its two-factor authentication.

    If you want to keep using standards like IMAP and SMTP to access email with Gmail, you will have to put up with them calling this insecure.

      Do you mean there's a way to send/receive mail via Gmail without using SMTP/IMAP?

        Yes, you'd have to use the google APIs to send the mssage which involves an OAuth login.

        Good Day,
            Dean

        You can set application specific passwords for applications to use SMTP. I suspect this applies to IMAP, but my success has varied in getting email this way due to rate limiting. A more reliable approach I've found is using fetchmail with gmail to get the mail. If you wish to send many emails (even with a "gmail" address), AWS' Simple Email Service (SES) has proven super reliabe for me and is super cheap.