Kodda problem yok, mail gitmekte fakat imap ile ilgili herhangi bir örnek verebilir misiniz ? Sonuçta onda da header kullanmanız gerekicek =)