और कैसे प्राप्त करने के लिए ईमेल का उपयोग पार्स POP3 और PHP

1 मार्च, 2010 व्यवस्थापक द्वारा एक उत्तर छोड़ दो »

मैं कैसे आने वाली मेल के लिए प्रोसेसर लिखने के लिए पर कुछ तरीकों का वर्णन करना चाहूँगा. मैं इस तरह के हेरफेर करने के लिए प्रयोग किया था पार्स ई मेल विभिन्न स्रोतों से प्राप्त. यह अपने खुद के स्पैम फिल्टर प्रणाली लेखन के लिए उपयोगी हो सकता है, जवाब दे मशीन या ई टिकट प्रणाली के आवेदन प्राप्त करने के लिए मेल.

ई - मेल पार्सर एल्गोरिथ्म हम की जरूरत को लागू करने के लिए

  1. कनेक्ट और लॉग पर ई - मेल सर्वर से
  2. आने वाले पत्रों की संख्या की गिनती
  3. ई recive सर्वर से मेल POP3 प्रोटोकॉल का उपयोग
  4. प्रक्रिया ई - मेल शीर्ष लेख और शरीर और पार्स करना
  5. … किसी भी अतिरिक्त कार्यों को लागू

अच्छा, वहाँ बहुत विशिष्ट कार्य के लिए है PHP कोडन, इसलिए हम होस्टिंग की जरूरत है कि बाहरी कनेक्शन समर्थन करता है. मैं पूरी तरह क्योंकि पहले से ही बहुत प्रतिभाशाली प्रोग्रामर द्वारा महसूस किया गया है निर्णय लिखने का प्रस्ताव नहीं है. For example, आप एक तैयार मॉड्यूल जो स्वीकार लेने की अनुमति देगा ई सकता है एक दूरस्थ सर्वर से मेल.

मैनुअल Lemos है और उसके लिए धन्यवाद मॉड्यूल (php वर्ग) जो pop3.php नाम.

अपने कोड के लिए उस वर्ग कनेक्ट करने के लिए, तुम बस में शामिल हैं या आदेश की आवश्यकता होती है उपयोग करने की आवश्यकता: आवश्यकता(“pop3.php”);


hostname=$hostname;
$result=$pop3_connection->Open();

// We are trying to open connection and display the result
echo $result;
// Trying to logon and display the error if any appear
$error=$pop3_connection->Login($user,$accesscode,$apop);
अगर ($त्रुटि<>'पासवर्ड त्रुटि: Logon विफलता: अज्ञात उपयोगकर्ता नाम या पासवर्ड बुरा. ') {echo $error; निकास;}
// Now get the statistic how many emails are stored and the size of them $result=$pop3_connection->Statistics($messages, $size);
गूंज "$hostname contains  $messages की $size bytes.";

//..... वहाँ हम ई प्राप्त कर सकते हैं-चक्र में मेल और उन्हें विश्लेषण .... //

// अगर कुछ भी नहीं करने के लिए - we can close the connection
$error=$pop3_connection->Close(); //
echo $error;
?>

अब हम जानते हैं कि कैसे कनेक्ट और लॉग इन करने के लिए POP3 सर्वर पर इनबॉक्स में ईमेल की संख्या अनुरोध करता है और उन्हें कैसे आकार. अगला, हम एक ई - मेल प्राप्त करने और हेडर और शरीर सरणी पार्स चाहिए.

जारी होना

साझा करें और आनंद लें

  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
विज्ञापन
  1. सोना कहते हैं:

    बड़ा, जो काम कर रहा है, अब क्या? ई - मेल प्राप्त करने के लिए कैसे? कैसे लिखने के लिए ई मेल पार्सर? कृपया जारी रखने के, महान पोस्ट!

  2. Waipahu locksmith कहते हैं:

    Fantastic Post. I have read many posts on this subject and you done the best job. Keep it up!

  3. web application technology कहते हैं:

    You can not believe just how long ive been googling because of this. Through seven pages of Digg results with out finding anything. 1 search on Msn. There this isGotta start using this more often ebrantley@kc.rr.com

एक उत्तर दें छोड़ दो

आप होना चाहिए लॉगिन एक टिप्पणी पोस्ट करने के लिए.