Arama butonu
Bu konudaki kullanıcılar: 1 misafir, 1 mobil kullanıcı
14
Cevap
453
Tıklama
0
Öne Çıkarma
Mail kutusu hakkında bir yardım?
N
11 yıl
Yüzbaşı
Konu Sahibi

Arkadaşlar aşağıdaki kodda aynen bu resimdeki gibi yapmak istiyorum bir türlü yapamamadım yardımcı olabilecek varmı?
http://postimg.org/image/6lv472oc9/



<?php 
$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
$username = 'gmailhesap@gmail.com';
$password = 'sifren';

$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to server: ' . imap_last_error());

$emails = imap_search($inbox,'ALL');

if($emails) {
$output = '';
rsort($emails);

foreach($emails as $email_number) {
$overview = imap_fetch_overview($inbox,$email_number,0);
$structure = imap_fetchstructure($inbox, $email_number);

if(isset($structure->parts) && is_array($structure->parts) && isset($structure->parts[1])) {
$part = $structure->parts[1];
$message = imap_fetchbody($inbox,$email_number,2);

if($part->encoding == 3) {
$message = imap_base64($message);
} else if($part->encoding == 1) {
$message = imap_8bit($message);
} else {
$message = imap_qprint($message);
}
}

$output.= '<div class="toggle'.($overview[0]->seen ? 'read' : 'unread').'">';
$output.= '<span class="from">Kimden: '.utf8_decode(imap_utf8($overview[0]->from)).'</span>';

$output.= '<br /><span class="subject">Konu('.$part->encoding.'): '.utf8_decode(imap_utf8($overview[0]->subject)).'</span>';
$output.= '</div>';

$output.= '<div class="body">'.$message.'</div>';

}

echo $output;
}

imap_close($inbox);
?>


DH forumlarında vakit geçirmekten keyif alıyor gibisin ancak giriş yapmadığını görüyoruz.

Üye olduğunda özel mesaj gönderebilir, beğendiğin konuları favorilerine ekleyip takibe alabilir ve daha önce gezdiğin konulara hızlıca erişebilirsin.

Üye Ol Şimdi Değil



K
11 yıl
Yarbay

Kodun calistigindan eminsen gmail hesabinda ayarlarda imap i etkinlestirmen gerekli. O zaman verilere erisebilirsin.



< Bu ileti mobil sürüm kullanılarak atıldı >
Bu mesaja 1 cevap geldi.
N
11 yıl
Yüzbaşı
Konu Sahibi

quote:

Orijinalden alıntı: Kaygerya

Kodun calistigindan eminsen gmail hesabinda ayarlarda imap i etkinlestirmen gerekli. O zaman verilere erisebilirsin.

kod çalışıyor kardeş benim yapmak istediğim olay resimdeki gibi ...

anlık mesajlaşma facebook gibi birşey kullanıyorsan mesaj atabilirmisin?


Bu mesaja 1 cevap geldi.
K
11 yıl
Yarbay

quote:

Orijinalden alıntı: nexus can

quote:

Orijinalden alıntı: Kaygerya

Kodun calistigindan eminsen gmail hesabinda ayarlarda imap i etkinlestirmen gerekli. O zaman verilere erisebilirsin.

kod çalışıyor kardeş benim yapmak istediğim olay resimdeki gibi ...

anlık mesajlaşma facebook gibi birşey kullanıyorsan mesaj atabilirmisin?

Su an yok haci. Mobildeyim. Ve sehir disindayim :(



< Bu ileti mobil sürüm kullanılarak atıldı >
Bu mesaja 1 cevap geldi.
N
11 yıl
Yüzbaşı
Konu Sahibi

quote:

Orijinalden alıntı: Kaygerya


quote:

Orijinalden alıntı: nexus can

quote:

Orijinalden alıntı: Kaygerya

Kodun calistigindan eminsen gmail hesabinda ayarlarda imap i etkinlestirmen gerekli. O zaman verilere erisebilirsin.

kod çalışıyor kardeş benim yapmak istediğim olay resimdeki gibi ...

anlık mesajlaşma facebook gibi birşey kullanıyorsan mesaj atabilirmisin?

Su an yok haci. Mobildeyim. Ve sehir disindayim :(

ne zaman gelirsin 1 hafta sürem var?



K
11 yıl
Yarbay

Iyi de haci ben php den hic anlamam yardim edebilecegim cok bisey yok



< Bu ileti mobil sürüm kullanılarak atıldı >

N
11 yıl
Yüzbaşı
Konu Sahibi

Bu nasil istir en sonunda 10.000 tl koyucam isin basina.



< Bu ileti mobil sürüm kullanılarak atıldı >

A
11 yıl
Yüzbaşı

N
11 yıl
Yüzbaşı
Konu Sahibi

quote:

Orijinalden alıntı: aksoydesign

Sana daha kapsamlı bir imap önereyim. eminim işine yarayacaktır.


http://www.backslash.gr/content/blog/webdevelopment/8-check-your-email-with-php-and-imap


demo adresi:

http://www.backslash.gr/demos/php-imap-mailboxes/

Download:

http://www.backslash.gr/demos/php-imap-mailboxes/php-imap-mailboxes.zip

kardeş bir kendin çalıştırıp atarmısın hatalar alıyorum ayarları yaptığım halde.


Bu mesaja 1 cevap geldi.
A
11 yıl
Yüzbaşı

localhostta hata alırsın. normal sunucuda çalıştırman gerekiyor ve phpdll de imap açık olması geekiyor


Bu mesaja 1 cevap geldi.

Bu mesajda bahsedilenler: @nexus can
N
11 yıl
Yüzbaşı
Konu Sahibi

quote:

Orijinalden alıntı: aksoydesign

localhostta hata alırsın. normal sunucuda çalıştırman gerekiyor ve phpdll de imap açık olması geekiyor

Tum sunucular localhost mantigi ile calismiyormu zaten :D tam aradigim olay bu ama imap dll kismina bakicam.



< Bu ileti mobil sürüm kullanılarak atıldı >
Bu mesaja 1 cevap geldi.
A
11 yıl
Yüzbaşı

 
<?php
##################################################################
# IMAP Inbox Notifier
# by Nikos Tsaganos
#http://www.backslash.gr - nikos@backslash.gr
#
# DISCLAIMER:
# This is a demo on how to use some imap php functions.
# It is NOT recommended to store your passwords in an
# unencoded php file on a shared server.
##################################################################

// general password protection
// leave blank if you don't want to protect this page
$pageauth['username'] = 'demo';
$pageauth['password'] = 'demo123';


// configure your imap mailboxes
$mailboxes = array(
array(
'label' => 'Gmail',
'enable' => true,
'mailbox' => '{imap.gmail.com:993/imap/ssl}INBOX',
'username' => 'isism@gmail.com',
'password' => '123456'
),
array(
'label' => 'My Cpanel website',
'enable' => true,
'mailbox' => '{mail.yourdomain.com:143/notls}INBOX',
'username' => 'info+yourdomain.com',
'password' => 'yourpassword'
)
);

if ($pageauth['username'] && $pageauth['password']) {
if(($_SERVER["PHP_AUTH_USER"]!==$pageauth['username']) || ( $_SERVER["PHP_AUTH_PW"]!==$pageauth['password'])){
header("WWW-Authenticate: Basic realm=Protected area" );
header("HTTP/1.0 401 Unauthorized");
echo "Protected area";
exit;
}
}


// a function to decode MIME message header extensions and get the text
function decode_imap_text($str){
$result = '';
$decode_header = imap_mime_header_decode($str);
foreach ($decode_header AS $obj) {
$result .= htmlspecialchars(rtrim($obj->text, "\t"));
}
return $result;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Mailbox checker with PHP and IMAP - Backslash</title>
<link href="css/demo.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="main">

<h1>Mailbox checker with PHP and IMAP</h1>

<p>For more demos like this visit <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=91952433&url=http://www.backslash.gr/" data-href="http://www.backslash.gr/">Backslash.gr</a>.</p>

<div id="mailboxes">
<?php if (!count($mailboxes)) { ?>
<p>Please configure at least one IMAP mailbox.</p>
<?php } else {

foreach ($mailboxes as $current_mailbox) {
?>
<div class="mailbox">
<h2><?php echo $current_mailbox['label']; ?></h2>
<?php
if (!$current_mailbox['enable']) {
?>
<p>This mailbox is disabled.</p>
<?php
} else {

// Open an IMAP stream to our mailbox
$stream = @imap_open($current_mailbox['mailbox'], $current_mailbox['username'], $current_mailbox['password']);

if (!$stream) {
?>
<p>Could not connect to: <?php echo $current_mailbox['label']; ?>. Error: <?php echo imap_last_error(); ?></p>
<?php
} else {
// Get our messages from the last week
// Instead of searching for this week's message you could search for all the messages in your inbox using: $emails = imap_search($stream,'ALL');
$emails = imap_search($stream, 'SINCE '. date('d-M-Y',strtotime("-1 week")));

if (!count($emails)){
?>
<p>No e-mails found.</p>
<?php
} else {

// If we've got some email IDs, sort them from new to old and show them
rsort($emails);

foreach($emails as $email_id){

// Fetch the email's overview and show subject, from and date.
$overview = imap_fetch_overview($stream,$email_id,0);
?>
<div class="email_item clearfix <?php echo $overview[0]->seen?'read':'unread';?>"> <?php // add a different class for seperating read and unread e-mails ?>
<span class="subject" title="<?php echo decode_imap_text($overview[0]->subject); ?>"><?php echo decode_imap_text($overview[0]->subject); ?></span>
<span class="from" title="<?php echo decode_imap_text($overview[0]->from); ?>"><?php echo decode_imap_text($overview[0]->from); ?></span>
<span class="date"><?php echo $overview[0]->date; ?></span>
</div>
<?php
}
}
imap_close($stream);
}

}
?>
</div>
<?php
} // end foreach
} ?>
</div>

</div><!-- #main -->

<div id="footer">
<p>Copyright © 2011 <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=91952433&url=http://www.backslash.gr" data-href="http://www.backslash.gr">Backslash</a> • Created by <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=91952433&url=http://www.backslash.gr" data-href="http://www.backslash.gr">Nikos Tsaganos</a></p>
</div>
</div><!-- #wrapper -->
</body>
</html>



Local hostta bunu kullan. düzenledim. ayrıca php.ini yi aç satırlar arasında ;extension=php_imap.dll olacak bunun başındaki ; noktalı virgülü kaldır.


Bu mesaja 1 cevap geldi.

Bu mesajda bahsedilenler: @nexus can
N
11 yıl
Yüzbaşı
Konu Sahibi

quote:

Orijinalden alıntı: aksoydesign

 
<?php
##################################################################
# IMAP Inbox Notifier
# by Nikos Tsaganos
#http://www.backslash.gr - nikos@backslash.gr
#
# DISCLAIMER:
# This is a demo on how to use some imap php functions.
# It is NOT recommended to store your passwords in an
# unencoded php file on a shared server.
##################################################################

// general password protection
// leave blank if you don't want to protect this page
$pageauth['username'] = 'demo';
$pageauth['password'] = 'demo123';


// configure your imap mailboxes
$mailboxes = array(
array(
'label' => 'Gmail',
'enable' => true,
'mailbox' => '{imap.gmail.com:993/imap/ssl}INBOX',
'username' => 'isism@gmail.com',
'password' => '123456'
),
array(
'label' => 'My Cpanel website',
'enable' => true,
'mailbox' => '{mail.yourdomain.com:143/notls}INBOX',
'username' => 'info+yourdomain.com',
'password' => 'yourpassword'
)
);

if ($pageauth['username'] && $pageauth['password']) {
if(($_SERVER["PHP_AUTH_USER"]!==$pageauth['username']) || ( $_SERVER["PHP_AUTH_PW"]!==$pageauth['password'])){
header("WWW-Authenticate: Basic realm=Protected area" );
header("HTTP/1.0 401 Unauthorized");
echo "Protected area";
exit;
}
}


// a function to decode MIME message header extensions and get the text
function decode_imap_text($str){
$result = '';
$decode_header = imap_mime_header_decode($str);
foreach ($decode_header AS $obj) {
$result .= htmlspecialchars(rtrim($obj->text, "\t"));
}
return $result;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Mailbox checker with PHP and IMAP - Backslash</title>
<link href="css/demo.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="main">

<h1>Mailbox checker with PHP and IMAP</h1>

<p>For more demos like this visit <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=91956327&url=http://www.backslash.gr/" data-href="http://www.backslash.gr/">Backslash.gr</a>.</p>

<div id="mailboxes">
<?php if (!count($mailboxes)) { ?>
<p>Please configure at least one IMAP mailbox.</p>
<?php } else {

foreach ($mailboxes as $current_mailbox) {
?>
<div class="mailbox">
<h2><?php echo $current_mailbox['label']; ?></h2>
<?php
if (!$current_mailbox['enable']) {
?>
<p>This mailbox is disabled.</p>
<?php
} else {

// Open an IMAP stream to our mailbox
$stream = @imap_open($current_mailbox['mailbox'], $current_mailbox['username'], $current_mailbox['password']);

if (!$stream) {
?>
<p>Could not connect to: <?php echo $current_mailbox['label']; ?>. Error: <?php echo imap_last_error(); ?></p>
<?php
} else {
// Get our messages from the last week
// Instead of searching for this week's message you could search for all the messages in your inbox using: $emails = imap_search($stream,'ALL');
$emails = imap_search($stream, 'SINCE '. date('d-M-Y',strtotime("-1 week")));

if (!count($emails)){
?>
<p>No e-mails found.</p>
<?php
} else {

// If we've got some email IDs, sort them from new to old and show them
rsort($emails);

foreach($emails as $email_id){

// Fetch the email's overview and show subject, from and date.
$overview = imap_fetch_overview($stream,$email_id,0);
?>
<div class="email_item clearfix <?php echo $overview[0]->seen?'read':'unread';?>"> <?php // add a different class for seperating read and unread e-mails ?>
<span class="subject" title="<?php echo decode_imap_text($overview[0]->subject); ?>"><?php echo decode_imap_text($overview[0]->subject); ?></span>
<span class="from" title="<?php echo decode_imap_text($overview[0]->from); ?>"><?php echo decode_imap_text($overview[0]->from); ?></span>
<span class="date"><?php echo $overview[0]->date; ?></span>
</div>
<?php
}
}
imap_close($stream);
}

}
?>
</div>
<?php
} // end foreach
} ?>
</div>

</div><!-- #main -->

<div id="footer">
<p>Copyright © 2011 <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=91956327&url=http://www.backslash.gr" data-href="http://www.backslash.gr">Backslash</a> • Created by <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=91956327&url=http://www.backslash.gr" data-href="http://www.backslash.gr">Nikos Tsaganos</a></p>
</div>
</div><!-- #wrapper -->
</body>
</html>



Local hostta bunu kullan. düzenledim. ayrıca php.ini yi aç satırlar arasında ;extension=php_imap.dll olacak bunun başındaki ; noktalı virgülü kaldır.



Allah razı olsun kardeşim ama resimler gözükmüyor ve tam istediğim şekil ama üstüne tıklayıncada mail içeriği açılmıyor D:



A
11 yıl
Yüzbaşı

quote:

Orijinalden alıntı: aksoydesign

Sana daha kapsamlı bir imap önereyim. eminim işine yarayacaktır.


http://www.backslash.gr/content/blog/webdevelopment/8-check-your-email-with-php-and-imap


demo adresi:

http://www.backslash.gr/demos/php-imap-mailboxes/

Download:

http://www.backslash.gr/demos/php-imap-mailboxes/php-imap-mailboxes.zip

resimler buradaki css dosyasında. bunu kullan. ayrıca daha kapsamlı yapmak için başka örnekleri incele örneğin senin ilk verdiğin kodlarda tıklayınca açılma olayı oluyor muydu eğer oluyorsa kodlarını buna göre uyarla standart bir yapısı vardır zaten bunun zorlanmayacağını tahmin ediyorum


Bu mesaja 1 cevap geldi.

Bu mesajda bahsedilenler: @nexus can
N
11 yıl
Yüzbaşı
Konu Sahibi

quote:

Orijinalden alıntı: aksoydesign

quote:

Orijinalden alıntı: aksoydesign

Sana daha kapsamlı bir imap önereyim. eminim işine yarayacaktır.


http://www.backslash.gr/content/blog/webdevelopment/8-check-your-email-with-php-and-imap


demo adresi:

http://www.backslash.gr/demos/php-imap-mailboxes/

Download:

http://www.backslash.gr/demos/php-imap-mailboxes/php-imap-mailboxes.zip

resimler buradaki css dosyasında. bunu kullan. ayrıca daha kapsamlı yapmak için başka örnekleri incele örneğin senin ilk verdiğin kodlarda tıklayınca açılma olayı oluyor muydu eğer oluyorsa kodlarını buna göre uyarla standart bir yapısı vardır zaten bunun zorlanmayacağını tahmin ediyorum

Yok anlamadin yani mailin icindeki resimler gozukmuyor. Ve elimde hic yok acilma olayi. Jquery ile Yapmak istedim ama olmuyor. Phpnin icinde nasil kullanilacagini bilmiyorum.



< Bu ileti mobil sürüm kullanılarak atıldı >

DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.