Avatar billede 123maka Nybegynder
07. september 2004 - 14:14 Der er 1 løsning

Php og imap, få de MIME-types væk

Jeg er igang med et lille mail system. Sourcecoden ser sådan ud ligenu:
<?php
include('top.php');
$header=imap_header($link,$_GET[num]);

//Vis at mailen er set :(
$status = imap_setflag_full($link, "$_GET[num]", "\\Seen");

$from_name = $header->from[0]->personal;
$from_mail = $header->from[0]->mailbox;
$from_host = $header->from[0]->host;

$to_name = $header->to[0]->personal;
$to_mail = $header->to[0]->mailbox;
$to_host = $header->to[0]->host;

$timestamp = $header->udate;

$msg_topic = $header->subject;

$msg = imap_body($link,$_GET[num]);


echo"<a href=\"messages.php\"><- Tilbage</a><br><br><table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" bgcolor=\"#B9C39B\" style=\"border: 1px solid #000000;\">
  <tr>
    <td width=\"6%\">
    <b>Emne:</b>
    </td>
    <td width=\"94%\">$msg_topic</td>
  </tr>
  <tr>
    <td width=\"6%\">
      <b>Fra:</b>
    </td>
    <td width=\"94%\">$from_name &lt;$from_mail@$from_host&gt;</td>
  </tr>
  <tr>
    <td width=\"6%\">
      <b>Dato:</b>
    </td>
    <td width=\"94%\">"; dato($timestamp); echo"</td>
  </tr>
</table>
<br>
<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">
  <tr>
    <td style=\"border: 1px solid #000000;\">$msg</td>
  </tr>
  <tr>
    <td>Besvar</td>
  </tr>
</table><br>";

include('bottom.php');
?>

Men problemet er at MIME-typesne kommer med, fx. sådan her:

"This is a multi-part message in MIME format. --_----------=_10944139467020 Content-Transfer-Encoding: binary Content-Type: multipart/alternative; boundary="_----------=_10944139467021" MIME-Version: 1.0 X-Mailer: MIME::Lite 1.5 (F2.73; T1.001; A1.62; B3.01; Q3.01) Date: Sun, 5 Sep 2004 19:52:26 UT This is a multi-part message in MIME format. --_----------=_10944139467021 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain *WELCOME_TO_FASTMAIL* *INTRODUCTION* Please read this email now, or at least keep it on file so you can read it in the future. It contains useful information about how to use your account, how to get help, how to contact us and how to upgrade. We've sent you this email just to get you started with using FastMail. As you can see, you can read any emails that arrive simply by clicking on the subject line. You can access the various FastMail screens, such as editing your address book, composing a new message, etc. by clicking on the links at the top of this page. *GETTING_HELP* FastMail has an extensive help system. If at any time you need help, you can: * Click *Help* at the top of each screen to get help on that screen * Click the small *?* next to any particular screen item to get help on that item * Click the *Start_here* link at the bottom of every screen to get detailed, searchable information about any FastMail feature * Post on our dedicated forum at http://www.emaildiscussions.com If your question is not answered by the FAQ, and is not a suitable question for the forum, then you can directly email the developers. Remember that time spent answering users' questions is time that the developers are not working on improving the service, so do your best to answer your own question first. PLEASE DO NOT EMAIL US UNTIL YOU HAVE READ THE INFORMATION AT THIS LINK *PREFERENCES* One of the first things we recommend you do is go to the *Options* screen (see the top right hand corner of the screen) and then the *Account_Preferences* screen. From there, you can setup your preferred options, such as your default screen size, your preferred color scheme and your time zone. *FASTMAIL_FEATURES* The Options screen also has links to many other FastMail features such as: * *Define_Rules* to automatically file/reject emails based on various criteria * Set up *Pop_Links* to automatically retrieve email from external POP/HotMail accounts to FastMail * Add, delete or rename *Folders* * *Upgrade* your account for more disk space and features. If you have a suggestion for a feature, please see our coming enhancements page first to see if we're already planning on it. *ACCESSING_YOUR_FASTMAIL_EMAIL_AT_HOME* We recommend setting up your local email software (such as Outlook Express, Eudora, Netscape Messenger, Pine, etc.) to access your FastMail account through IMAP. Everyone gets access to the FastMail IMAP server to access their email. See here for more details on how to set this up. You CANNOT use the FastMail POP mail server to access/download your FastMail email unless you have a Full or Enhanced account. Please see this link for why we believe that IMAP is better than POP anyway. See below for details on how to upgrade. You CANNOT use the FastMail SMTP (Outgoing) mail server to send email from home unless you have a Member, Full or Enhanced account. You can however still use your ISP's SMTP (Outgoing) mail server. The instructions for setting up IMAP above explain what to do if you want to send emails but don't want to upgrade. See below for details on how to upgrade. *SHOULD_I_UPGRADE_MY_ACCOUNT* FastMail gives you, for free, one of the most powerful mail services anywhere on the Internet! Free users get access to everything at the "Guest" service level, which provides all the features necessary for casual email users. If you rely on email on a day-to-day basis, or you need to send and receive large attachments, you should consider upgrading your account. If you're not sure if you need to upgrade, a step-by-step "Do I need to upgrade?" guide can be found here. You can also look at our pricing table to see the specific feature supplied at each service level. *HOW_DO_I_UPGRADE_MY_ACCOUNT* Upgrading is easy with a credit card. You simply go to the *Options* screen and click the *Upgrade* link. If you don't have a credit card, see this link for more information on how to pay. A brief summary of each service levels features can be found here. See our pricing table for detailed information about the different FastMail service levels, what they provide, and what they cost. *AND_FINALLY...* We hope you find FastMail the fastest and easiest way to access your email. If you have any comments or questions, try checking out the links at the bottom of every screen. Feel free to email us at webmaster@fastmail.fm, but remember to please read this first. The FastMail Team --_----------=_10944139467021 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/html"



Hvordan fjerner jeg de mime types?
Avatar billede 123maka Nybegynder
25. oktober 2004 - 10:48 #1
lukker
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester