php imap电子邮件正文阅读

I am getting my email by imap, but stuck up with one email in my inbox which have letter  in it, and imap is not going to get its body. rest of emails going to read fine. Its header is fine, its going to read.

how I can get body of email with this kind of letters

Code sample is here

$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to mail server: ' . imap_last_error());
$emails = imap_search($inbox,'SUBJECT "UKPF - New Booking"'); 
$overview = imap_fetch_overview($inbox,$email_number,0);
$message  = imap_fetchbody($inbox,$email_number,2);

I have solved this issue using this quoted printable decode php function. In your case:

$message = quoted_printable_decode($imap_fetchbody($inbox,$email_number,2));

I used to have problems with certain characters too in my php form, this helped:

I put this

"MIME-Version: 1.0; Content-Type: text/plain; charset=utf-8"

in the mail() parameters. I don't know what imap is or how this works different, but hopefully this'll help.