Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maximum url length that can be safely used in an email?

My website sends out an email with a link in it. Lately we've been getting a lot of errors that indicate that the URL in the email that we send out is being somehow garbled. Unfortunately we dont' have any logs that indicate what the url they tried to access was exactly. I've ruled out a number of possibilities (bad data, bad url encoding, etc) The only thing I haven't ruled out is that perhaps the url is being truncated by our users email clients. The URL is slightly different for each user, but generally the url will be 210 - 220 characters in length.

My question: As a rule of thumb, what is the maximum url length that can be be safely sent in an email client, to ensure consistent behavior?

UPDATE

I know that there are a number of questions on SO related to the maximum URL length, but my question is specific to a hyperlink in an email client, and I can't seem to find that.

like image 340
aamiri Avatar asked Oct 21 '22 14:10

aamiri


1 Answers

Good style recommendation [URL length <= recommended line length]

URL should fit into a single line, single email line should be 78 chars (minus at least two chars for quoting in reply).

https://www.rfc-editor.org/rfc/rfc5322.txt

2.1.1. Line Length Limits

There are two limits that this specification places on the number of characters in a line. Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF

like image 194
AnFi Avatar answered Oct 27 '22 10:10

AnFi