John Magnolia
John Magnolia

Reputation: 16793

Base64 encode from name for email

Why does the opencart mail class encode the senders name?

$header .= 'From: ' . '=?UTF-8?B?' . base64_encode($this->sender) . '?=' . '<' . $this->from . '>' . $this->newline;

Is this an old technique? I haven't seen it like this before.

Are there any disadvantages to encoding it?

Upvotes: 1

Views: 1322

Answers (1)

Ravi
Ravi

Reputation: 2086

Quoted from Wikipedia:

This is to ensure that the data remain intact without modification during transport. Base64 is commonly used in a number of applications including email via MIME. Base64

The MIME standard introduced character set specifiers and two content transfer encodings to enable transmission of non-ASCII data: quoted printable for mostly 7 bit content with a few characters outside that range and base64 for arbitrary binary data. Content Encoding

Upvotes: 2

Related Questions