libcurl.pbi

Share your advanced PureBasic knowledge/code with the community.
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

Look at:

Code: Select all

Procedure.i IMAP_Search(*IMAP.IMAPStructure, List MailIDList.i(), Search$="NEW", TargetFolder$="INBOX")
Especially at the option TargetFolder$
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: libcurl.pbi

Post by Little John »

How could I miss this thread? :)
Many thanks, infratec :!:
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

Added

EMailWithFileAttachment.pb

as example.
Fruity
New User
New User
Posts: 5
Joined: Tue Aug 15, 2023 4:04 am

Re: libcurl.pbi

Post by Fruity »

Does it work on Linux?
User avatar
jacdelad
Addict
Addict
Posts: 1993
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: libcurl.pbi

Post by jacdelad »

Fruity wrote: Sat Oct 28, 2023 10:49 am Does it work on Linux?
Only if you get the DLL to work.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

Yes, it works in linux and macOS too.
GogaII
User
User
Posts: 29
Joined: Sun Nov 15, 2020 10:03 am

Re: libcurl.pbi

Post by GogaII »

I tried to launch the file FTPS_download.pb and received "invalid memory access (write error at address 0)" in the line curl_global_init(#CURL_GLOBAL_DEFAULT)
I compiled the file in exe, launched it as an Administrator, and set my path for #LOCAL_FILE, but it didn't help.
Could you show an example of a file download with the progress()?
I appreciate any help you can provide.
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

ftps is not available in the PB inbuild libcurl.

That's the reason for:

Code: Select all

#LibCurl_ExternalDLL = #True
But then you need to copy the libcurl.dll beside your exe.
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

Updated the libcurl dll to 8.4.0

Changed the ImportC statement for linux and macOS.
Added an error message when curl_easy_perform() fails in the default example.

But ... it looks like I have a problem on macOS ARM.

Code: Select all

curl_easy_setopt_str(curl, #CURLOPT_URL, "https://www.purebasic.fr")
Does not work. On Intel mac -> no problem.
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

Added a small example for pop3s

It reads the first email in the INBOX
Tested with gmx.net (you need to enable pop3 access inside gmx)
BarryG
Addict
Addict
Posts: 4128
Joined: Thu Apr 18, 2019 8:17 am

Re: libcurl.pbi

Post by BarryG »

Thanks... but I have nothing in my Inbox at the moment, and the first email it gets for me is an archived one dated 18 Apr 2013. I ran it again and got a different archived old email. I really don't think there's going to be any way to achieve what I want (just parse the Inbox), but thanks for trying! I really appreciate it.
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

pop3: Added a procedure to get a list of the e-mails.

removed the file, stay tuned ...
Last edited by infratec on Sat Nov 18, 2023 12:16 pm, edited 1 time in total.
BarryG
Addict
Addict
Posts: 4128
Joined: Thu Apr 18, 2019 8:17 am

Re: libcurl.pbi

Post by BarryG »

Will wait for an update. Thanks for your patience and kindness!
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

Added more functions to pop3
BarryG
Addict
Addict
Posts: 4128
Joined: Thu Apr 18, 2019 8:17 am

Re: libcurl.pbi

Post by BarryG »

Just woke up to a new day and your new POP3 example works! Thanks! I've also got a version from HeX0R, so I'll see which works best for me. Thank you BOTH for helping me with this.
Post Reply