הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   Emails headers (https://hosts.co.il/forums/showthread.php?t=21676)

Tomer 12-05-06 16:22

Emails headers
 
אהלן,

אני מנסה לפרק את ה headers שמגיעים מהאימייל לכמה חלקים, ופשוט לא הולך לי, ה headers הם:

קוד:

------=_Part_27331_28312923.1147443914225
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

lolo

lili

lala

------=_Part_27331_28312923.1147443914225
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

lolo

lili

lala


------=_Part_27331_28312923.1147443914225--

אני צריך לקחת מפה רק את ההודעה, ואך ורק את ההודעה. יש רעיונות? :(

Alon.R 12-05-06 16:48

לא ממש הבנתי מה אתה רוצה :D

Tomer 12-05-06 16:50

ציטוט:

נכתב במקור על ידי Alon.R
לא ממש הבנתי מה אתה רוצה :D

לסנן את ה headers ולקבל רק את ההודעה.

בניה 12-05-06 16:54

ב"ה
PHP קוד:

<?php
$content
="------=_Part_27331_28312923.1147443914225
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

lolo

lili

lala

------=_Part_27331_28312923.1147443914225
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

lolo

lili

lala


------=_Part_27331_28312923.1147443914225--
"
;
preg_match_all("#\Content-Disposition: inline(.+?)\------=_Part_#is",$content,$matchs,PREG_PATTERN_ORDER);
print_r($matchs[1]);
?>

דוגמא חיה:
http://bnaya.be/phpfiles/parsemail.php

Tomer 12-05-06 17:10

בע, בניה, אני לא מצליח למצוא שיטה לסנן פשוט הודעות מכל הודעה שמגיעה.. זה סיוט..

זה עובד ל header מסויים ולשני לא, יש לך איזו שיטה לקחת פשוט את ההודעה ולא משנה מה ההאדר שמגיע?

BlueNosE 12-05-06 17:12

בניה תיכול לתת לי הסבר על הPREG MATCH ALL? אני לא מבין למה הוא שימושי?..
אתה ממש תותח בPCRE =]
עריכה, לבקשתך:
PHP קוד:

<?php
$content
="------=_Part_27331_28312923.1147443914225
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

lolo

lili

lala

------=_Part_27331_28312923.1147443914225
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

lolo

lili

lala


------=_Part_27331_28312923.1147443914225--
"
;
preg_match_all("#\Content-Disposition: [\w]+(.+?)\------=_Part_#is",$content,$matchs,PREG_PATTERN_ORDER);
print_r($matchs[1]);
?>



כל הזמנים הם GMT +2. הזמן כעת הוא 00:40.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ