बजाय एक क्रोम प्लगइन बनाने का, मैं या तो विंडो शीर्षक झपकी बनाने या एचटीएमएल 5 सूचनाएं का प्रयोग करेंगे। एक सरल पृष्ठ बनाएं जो आपके आईएमएपी जीमेल को नए संदेशों के लिए चुनाव करेगा, और एक बड़े आईफ्रेम में जीमेल शामिल करें। यदि कोई नया संदेश मिलता है, तो आपकी बाहरी विंडो अधिसूचना जारी कर सकती है।
एचटीएमएल 5 सूचनाएं: http://www.html5rocks.com/en/tutorials/notifications/quick/
शीर्षक (this से अपनाया) ब्लिंक करती:
var newMailBlinker = (function() {
var oldTitle = document.title,
msg = 'New Mail!',
timeoutId,
blink = function() {
document.title = document.title == msg ? ' ' : msg;
},
clear = function() {
clearInterval(timeoutId);
document.title = oldTitle;
window.onmousemove = null;
timeoutId = null;
};
return function() {
if (!timeoutId) {
timeoutId = setInterval(blink, 1000);
window.onmousemove = clear;
}
};
}());
पीएचपी पोल Gmail IMAP (this से अपनाया):
$t1=time();//mark time in
$tt=$t1+(60*1);//total time = t1 + n seconds
do{
if(isset($t2)) unset($t2);//clean it at every loop cicle
$t2=time();//mark time
if(imap_num_msg($imap)!=0){//if there is any message (in the inbox)
$mc=imap_check($imap);//messages check
//var_dump($mc); die;//vardump it to see all the data it is possible to get with imap_check() and them customize it for yourself
echo 'New messages available';
}else echo 'No new messagens';
sleep(rand(7,13));//Give Google server a breack
if([email protected]_ping($imap)){//if the connection is not up
//start the imap connection the normal way like you did at first
}
}while($tt>$t2);//if the total time was not achivied yet, get back to the beginning of the loop
jQuery AJAX अपने IMAP स्क्रिप्ट (this से अपनाया) के लिए मतदान:
// make the AJAX request
function ajax_request() {
$.ajax({
url: '/path/to/gmail/imap/checkMessages.php',
dataType: 'json',
error: function(xhr_data) {
// terminate the script
},
success: function(xhr_data) {
console.log(xhr_data);
if (xhr_data.status == 'No new messages') {
setTimeout(function() { ajax_request(); }, 15000); // wait 15 seconds than call ajax request again
} else {
newMailBlinker(); // blink the title here for new messages
}
}
contentType: 'application/json'
});
}
जाहिर है आप jQuery और पीएचपी प्रयोग नहीं करेंगे मतदान पर। मतदान करने के लिए एक उठाओ। मैं सलाह दूंगा कि क्लाइंट मतदान कर रहा है और प्रति कनेक्शन एक बार PHP जांच IMAP है। ऐसा कहा जा रहा है कि, इन स्निपेट्स को आपको शुरू करना चाहिए :)
सभी ग्राहक ... आप सभी सर्वर का मतलब है? जीमेल, हॉटमेल, याहू, और अन्य वेब आधारित ईमेल सेवाएं, और पॉप/इमेप सर्वर भी? – ixe013
@ ixe013 मेरा मतलब है किसी भी ग्राहक, मुझे परवाह नहीं है कि मैं किस का उपयोग करता हूं। उत्तर थंडरबर्ड के लिए कुछ विशिष्ट ऐड-ऑन हो सकता है। यह सभी ईमेल सेवाओं के लिए होने की आवश्यकता नहीं है। लेकिन इसे विंडोज और पॉप/इमेप के साथ काम करने की ज़रूरत है। – dezman
कोई भी ऐसा करने के बारे में भी क्यों सोचना चाहेगा? यदि आप वास्तव में ऐसा करने के लिए प्रबंधन करते हैं, तो अपने आप को सुरक्षित उपयोगकर्ताओं से नफरत मेल के असंख्य होने के लिए तैयार करें। – HerrSerker