i want use email on server cakephp imap custom datasource.
in database.php have:-
public $mycustomemail = array( 'datasource' => 'imapsource', 'server' => 'test.com', 'username' => 'info@test.com', 'password' => 'email password', 'port' => 143, 'ssl' => true, 'encoding' => 'utf-8', 'error_handler' => 'php', 'auto_mark_as' => array( 'seen', // 'answered', // 'flagged', // 'deleted', // 'draft', ), );
when set port
143
or ssl
true
error:-
error: unable imap_thread after 4 retries. 'tls/ssl failure radindesign.com: ssl negotiation failed'
when ssl
set false
or change port
error:-
unable imap_thread after 4 retries. 'certificate failure test.com: self signed certificate: /cn=linux10.centraldnserver.com/emailaddress=ssl@linux10.centraldnserver.com'
what's wrong imap authentication?
cakephp imap custom datasource didnt me use :
// configure imap mailboxes $mailboxes = array( array( 'label' => 'gmail', 'mailbox' => '{imap.gmail.com:993/imap/ssl}inbox', 'username' => 'yourusername@gmail.com', 'password' => 'yourpassword' ), array( 'label' => 'my cpanel website', 'mailbox' => '{mail.yourdomain.com:143/notls}inbox', 'username' => 'info+yourdomain.com', 'password' => 'yourpassword' ), array( 'label' => 'another mail account', 'mailbox' => '{mail.yourdomain.com:143/notls}inbox', 'username' => 'info@yourdomain.com', 'password' => 'yourpassword' )
);
//check inbox $current_mailbox = array( 'label' => 'my cpanel website', 'mailbox' => '{mail.test.com:143/notls}inbox', 'username' => 'info@test.com', 'password' => '***' ); // open imap stream our mailbox $stream = @imap_open($current_mailbox['mailbox'], $current_mailbox['username'], $current_mailbox['password']); $emails = imap_search($stream, 'since ' . date('d-m-y', strtotime("-1 week")));
// if we've got email ids, sort them new old , show them rsort($emails);
$i = 0; $overview = array(); foreach ($emails $email_id) { // fetch email's overview , show subject, , date. $overview[$i] = imap_fetch_overview($stream, $email_id, 0); $i++; }
var_dump($overview);
Comments
Post a Comment