Sample code for 30+ languages & platforms
PowerBuilder

Yahoo! IMAP (imap.mail.yahoo.com)

(from Wikipedia)
It is possible to get direct IMAP access without signing up for paid access nor using software like YPOPs! or FreePOPs. Yahoo! operates IMAP and secure IMAP servers (imap.mail.yahoo.com in particular), which are globally accessible. However they require a specific, non-standard IMAP command to be sent before login is done, namely: “ID ("GUID" "1")”.
This example demonstrates sending the non-standard IMAP command after connecting but before login.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Imap
string ls_RawResponse

li_Success = 0

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loo_Imap = create oleobject
li_rc = loo_Imap.ConnectToNewObject("Chilkat.Imap")
if li_rc < 0 then
    destroy loo_Imap
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// Connect to they Yahoo! IMAP server.
loo_Imap.Port = 993
loo_Imap.Ssl = 1
li_Success = loo_Imap.Connect("imap.mail.yahoo.com")
if li_Success <> 1 then
    Write-Debug loo_Imap.LastErrorText
    destroy loo_Imap
    return
end if

// Send the non-standard ID command...

ls_RawResponse = loo_Imap.SendRawCommand("ID (~"GUID~" ~"1~")")
if loo_Imap.LastMethodSuccess <> 1 then
    Write-Debug loo_Imap.LastErrorText
    destroy loo_Imap
    return
end if

// Login
li_Success = loo_Imap.Login("myLogin","myPassword")
if li_Success <> 1 then
    Write-Debug loo_Imap.LastErrorText
    destroy loo_Imap
    return
end if

Write-Debug "Login Success!"

// Select an IMAP mailbox
li_Success = loo_Imap.SelectMailbox("Inbox")
if li_Success <> 1 then
    Write-Debug loo_Imap.LastErrorText
    destroy loo_Imap
    return
end if

// Continue with whatever you wish to do...
// (see other examples..)

// Disconnect from the IMAP server.
li_Success = loo_Imap.Disconnect()


destroy loo_Imap