imap_body

(PHP 4, PHP 5, PHP 7, PHP 8)

imap_bodyİleti gövdesini okur

Açıklama

imap_body(resource $imap_akımı, int $ileti_num, int $seçenekler = 0): string|false

ileti_num ile belirtilen iletinin gövdesini döndürür.

imap_body() işlevi ileti gövdesinin bire bir kopyasını döndürür. Çok parçalı MIME kodlu bir iletiden tek bir parçayı elde etmek için önce yapı imap_fetchstructure() ile incelenmeli sonra da gövdeden istenen bölüm imap_fetchbody()ile çıkarılmalıdır.

Değiştirgeler

imap_akımı

imap_open() işlevinden dönen bir IMAP akımı.

ileti_num

İleti numarası.

seçenekler

Şunlardan gerekenleri içeren bir bit maskesidir:

  • FT_UID - ileti_num bir eşsiz kimliktir.
  • FT_PEEK - \Seen imi tanımlıysa bir daha tanımlanmaz.
  • FT_INTERNAL - CRLF ile meşrulaştırılmamış olarak dizgeyi dahili biçemde döndürür.

Dönen Değerler

Belirtilen iletinin gövdesi bir dizge olarak, başarısızlık durumunda false döner.

add a note add a note

User Contributed Notes 2 notes

up
10
deenfirdoush at gmail dot com
14 years ago
Simple example on how to read body message of the recent mail.

<?php
$imap
= imap_open("{pop.example.com:995/pop3/ssl/novalidate-cert}", "username", "password");

if(
$imap ) {
   
    
//Check no.of.msgs
    
$num = imap_num_msg($imap);

    
//if there is a message in your inbox
    
if( $num >0 ) {
         
//read that mail recently arrived
         
echo imap_qprint(imap_body($imap, $num));
     }

    
//close the stream
    
imap_close($imap);
}
?>
up
8
theloverkills at gmail dot com
7 years ago
Please note that the UID is NOT unique.
UID of the email may be not unique on the server (2 messages in different folders may have same UID).

Basically, don't use the UID as a unique identifier.
To Top