[Gambas-user] Receiving an email

Rolf-Werner Eilert eilert-sprachen at ...221...
Tue Jul 30 00:20:07 CEST 2013



Am 26.07.2013 22:38, schrieb Benoît Minisini:
> Le 26/07/2013 20:58, Sprachschule Eilert a écrit :
>> Hi Randall,
>>
>> I now got the gb.net.pop3 component to work, and your example works too.
>> However, I only receive the message headers, not the message bodies, and
>> the messages aren't downloaded and deleted from the server.
>>
>> This is what I got, when there were 3 messages in the inbox:
>>
>> Connected to mail server....
>> +OK Hello there. <29021.1374864315 at ...37...>
>> There are 3 Messages in your inbox.
>> You inbox contains 7501 bytes of data.
>> 1 802
>> 2 5581
>> 3 1118
>> Message: 1 802
>>
>> ----------------------------------------------------
>> +OK 802 octets follow.
>>
>>
>> Message: 2 5581
>>
>> ----------------------------------------------------
>> Received: (qmail 28836 invoked from network); 26 Jul 2013 19:35:08 +0200
>>
>>
>> Message: 3 1118
>>
>> ----------------------------------------------------
>> Received: from 95.58.25.201.megaline.telecom.kz (HELO 95.58.25.201)
>> (95.58.25.201)
>>
>>
>> Closing Connection.
>>
>>
>> As soon as I know how to get complete messages (in my case, these would
>> be the contact forms sent by customers via the contact form tool on my
>> website), I would add the DELE command to clean them from the server.
>>
>> Rolf
>>
>
> You don't have to issue the POP3 commands explicitely with the
> Pop3Client class. Look at the documentation:
>
> hConn.Count returns the number of messages.
>
> hConn[i] returns the i-th message.
>
> hConn[i].Size returns the message size.
>
> hConn[i].Text returns the message contents "as is".
>
> hConn[i].Message returns the message parsed as a MimeMessage object.
>
> hConn[i].Delete marks the message as being deleted. It will be actually
> deleted when you call hConn.Close(), but not if you call hConn.Abort().
>
> Then go look at the MimeMessage class documentation of gb.mime!
>
> Regards,
>


I found the reason why Randall's example didn't work like expected: The 
option for mails with more than line was missing.

Nevertheless, interesting tipps you had here for me, I'll keep gb.mime 
in mind.

And thanks for 3.4.2, running perfectly on my laptop!

Regards
Rolf




More information about the User mailing list