Papa De Beau
Papa De Beau

Reputation: 3828

PHP base64_decode! "@" comes out as a "¡"

I am pulling some code from an email (google) and it translates the code or encrypts it when I use an @ symbol it changes to and upside down explanation point.¡ I use the code below and it fixes it back to the @ symbol but it adds a "?" and the end or a "n". It also changes the $ to a funky symbol. Any ideas how to decode this properly? Again its a Google encryption. Don't know if that helps...

$Body = base64_decode($Body);
$Body = mb_convert_encoding($Body, "utf-8");
$Body = htmlspecialchars($Body);
$Body = preg_replace('/¡/',"@",$Body);

Upvotes: 4

Views: 319

Answers (1)

jmaitrehenry
jmaitrehenry

Reputation: 2400

I use this for fetching my email body from gmail.

$body = imap_fetchbody($inbox, $mail, 1);
$body = quoted_printable_decode($body);
$body = urldecode($body);

And it's work well

Upvotes: 1

Related Questions