[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pop3 Gambas & Gmail.


On Fri, 18 Oct 2024 at 14:04, Benoît Minisini <
benoit.minisini@xxxxxxxxxxxxxxxx> wrote:

> Le 18/10/2024 à 10:43, System64 Development a écrit :
> > Hi,
> >
> > I use this code to connect to a Gmail mailbox
> >
> >    $Pop = New Pop3Client
> >    $Pop.Host = "pop.gmail.com"
> >    $Pop.port = 995
> >    $Pop.User = "myname@xxxxxxxxx"
> >    $Pop.Encrypt = True
> >    $Pop.Password = "mypassword"
> >    If $Pop.Open() Then
> >      Print "Mensajes: " & $Pop.Stat[0] ' Messages numbers.
> >    Endif
> >
> > But doesn't work.
> >
> > ¿Is due to Gimail or perhaps the code is wrong?
> >
> > Im trying to made a program that:
> >
> > Read each messages from the mailbox
> >
> > Process the all the mails and create a pdf file for each one.
> >
> > Answer to all the "emailunique/senders" adding one attachment
> >
> > Martin.
> >
> >
>
> My Thunderbird can access some GMail account through POP3, but the
> Thunderbird of my mother never succeeded. Go figure...
>
> Anyway, you can set the Debug property of the Pop3Client to get the
> dialog with the server on the console.
>
> Regards,
>
> --
> Benoît Minisini.
>

Didn't anyone see my reply?

https://lists.gambas-basic.org/archive/user/2024-10/0000136.html

His problem is that Pop3Client.Open() ALWAYS returns false because although
it returns As Boolean there is nowhere in the function code that returns
True
Solution...

   Try $Pop.Open()  ' A few things in the Open method can Raise/Throw
an error so use Try
   If $Pop.Status = Net.Connected Then
     Print "Mensajes: " & $Pop.Stat[0] ' Messages numbers.
   Endif

References:
Pop3 Gambas & Gmail.System64 Development <64xcode@xxxxxxxxx>
Re: Pop3 Gambas & Gmail.Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>