PHP code example of morton1117 / mail

1. Go to this page and download the library: Download morton1117/mail library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

morton1117 / mail example snippets


$mail = new \Sxstem\Mails\Imap(username, passwork, [mailbox]);  //The mailbox defaults to inbox

$result = $mail->getFolder(); //get folder

//$result = $mail->getUid();  //before this,you can use $mail->setBeginDate(),$mail->setEndDate() to set bigin date, end date

//$result = $mail->getHeader($uid); //Not passing the uid means getting the headers for all messages under the current mailbox

//$result = $mail->getMsgnoByUid($uid);

//$result = $mail->getBody($msgno);

//$result = $mail->setFolder($mailbox);  //reconnect imap

$mail->imapClose();

$mail = new \Sxstem\Mails\Mark(username, passwork, [mailbox]);

$result = $mail->set_seen($uid);

//$result = $mail->clear_seen($uid);

//$result = $mail->set_flagged($uid);

//$result = $mail->clear_flagged($uid);

//$result = $mail->set_deleted($uid);

//$result = $mail->set_answered($uid);

//$result = $mail->move_mail($uid, $mailbox);

$mail->imapClose();
<<<<<<< HEAD

$mail = new \Sxstem\Mails\Smtp(username, passwork);
// $mail->debug(true);
$result = $mail->send($subject, $to, $cc, $mails_body, $attach, $in_reply_to, $references);
//$cc, $attach, $in_reply_to, $references can be ''