Jump to content

problem with reading email


php1

Recommended Posts

i am using php imap_fetchbody() function to read my email message.

 

php code:

 

$mbox = imap_open ($server,$user, $pass) or die("can't connect: " . imap_last_error());

$text=imap_fetchbody($mbox,$i,"1");

echo $text;

 

output:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//DE">

<HTML>

  <HEAD>

  <=META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii">=

 

    <TITLE>Message</TITLE>

  </HEAD>

  <BODY>Testing <=br>

  </BODY>

</HTML>

 

when i use

$text=strip_tags(imap_fetchbody($mbox,$i,"1"));

i got the output as :

=MessageTesting

 

ie there is a term =Message with all my email messages. How to avoid this?

 

Link to comment
https://forums.phpfreaks.com/topic/130384-problem-with-reading-email/
Share on other sites

Nope, you just have an error in your HTML template you're using. Replace it with this...

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//DE">
<HTML>
  <HEAD>
   <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii">
  <TITLE>Message</TITLE>
  </HEAD>
  <BODY>Testing<br>
  </BODY>
</HTML>

 

you had a couple of spurious = signs in there for some reason.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.