Letters are sometimes scrambled

People,

I have a website in PHP (using the QCubed framework ); as part of the site, I have a daemon that sends several thousand letters a day (no, I'm not a spammer, everything is fine :)). Email is sent through the user infrastructure component; this component serves as the SMTP client. I use a paid SMTP gateway from DNSExit.com to receive actually sent emails.

These emails are simple HTML-based emails; they really only have simple links inside.

My problem is that these links sometimes (not sequentially!) Get scrambled during the transition. Tags are somehow confused, and some links do not work in email. The problem arises in a small percentage of all emails sent; this is consistent (i.e., the same message from the HTML source code may or may not cause scrambling during the transition).

Have any of you seen this? Any thoughts on how to troubleshoot?

+6
php email qcubed
source share
6 answers

Is it possible that you are using temporary files to create emails (or at least to create the contents of a variable)? I did something vaguely similar once. Email text was generated and written to a temporary file based on the exact time in seconds. Unfortunately, when sending thousands per day, we played the same second more than once (since only 86 thousand seconds are available). This may explain a) a small error rate and b) an apparent randomness. To troubleshoot, I just look to see if the rate increases with the number of emails from there.

+3
source share

I had a similar problem on the server running sendmail.

I created and tested an html email that would one day be a mass mailing (of course, without participation). I had an email template that was easy for any html programmer to read, but as such was heavy in space to properly configure everything. I thought to myself: if it will be a mass email message, after creating the template, I think I will hide the space in the file to save space! Therefore, I created a brilliant regex to get rid of the excess, to send empty content from the displayed message.

When I sent the email to myself, I opened the letter and was puzzled when I saw that some of the css and html were not showing correctly when my previous messages before my regular expression were. Looking at the original message, I noticed that each time an exclamation mark (!) Appeared, it would seem, by chance in the entire message, thereby breaking any css and html that fell into its random path.

It turns out that sendmail doesn't like it if the line in your message gets too long without breaking the line. When the line gets too long, sendmail inserts an exclamation point, and then breaks the line right then and there, just to confuse and confuse you.

Why didn't he just choose a space between words and a line break? Why insert an exclamation mark? The questions I fear are unanswered.

My decision?

sudo apt-get remove sendmail sudo apt-get install exim4 

I had other problems with sendmail, as it took a full 60 seconds to send an email, and Exim4 just worked, and I never had to think about it again.

If your mail server uses sendmail, this can be a problem, if not, thanks for letting me share my story with you. I had to let go.

+1
source share

When you send an email, you must encode it so that each line in the body of the message is no more than 76 characters. You can use base64 for this, but most systems use coded encoding for text, as it generates smaller messages. Base64 is usually used only for binary data.

+1
source share

The problem is that HTML is not compatible with email. This is why I created the Markup Language .

HTML was created to work with the HTTP protocol, because these two technologies were invented by the same person at about the same time. The difference is that HTTP is a single session that is transmitted in a single motion from server to client. This never changes since the HTML document always appears on the server, is sent to the requesting client, and as soon as the transfer is completed, the connection between the client and server is dropped.

Email does not behave this way. In an e-mail message appears at the client, is sent to one or more mail services, and then ends on the remote client. However, the biggest difference is that the document does not die with the end of one instance of the transfer, as happens with the transfer of the document over HTTP. A document sent to SMTP can be sent, sent, or copied to several unsolicited users. This one of the differences is profound when it comes to email flow.

The problem is that SMTP and HTTP are different, as shown in the previous two paragraphs. These differences are compounded by the fact that SMTP and HTTP have radically different formatting methods for creating header data. HTML has header data that is designed to be compatible with HTTP transmission headers and does not comply with SMTP protocols. HTML headers also do not account for email flow complexity.

The problem is that when the email software distorts the HTML document to add formatting changes necessary to meet the relevant requirements of that software, and also to write the header data directly into the document. This example becomes extremely pronounced when an HTML email becomes an email flow. Because the HTML header data does not have a way to account for the complexity of the email flow, there is no way to provide appropriate definitions for descriptions from the stylesheet that survive the transmission of the document. Each time an HTML or HTML formatted document is sent from one email program to another, the document is corrupted and each email software distorts the previous corruption. Email processing software can link to either an email client, which will certainly damage the document, or an email server, which is likely to corrupt the email document.

The solution is to create a markup language agreement that directly recognizes the requirements for email header data. These requirements are defined in RFC 5321 for SMTP and RFC 5322 for client processing. The only way to properly distribute this solution to account for the complexity of email flow is to provide an agreement for the multidimensional DOM agent.

The paragraphs have been deleted due to technical inaccuracy and the difference between the term multi-agent DOM and the nature of the invented function, not mentioned here even before editing.

EDIT: The multi-agent DOM applies some degree of hierarchy that might not be required to represent email flow.

+1
source share

There were 2 problems with email data - usually "?" the symbol somehow got inside some words, the other - UTF and the title associated with it. First “fixed” by changing the hosting provider (as it was associated with the mail server), the second fixed by changing the PHPmailer library.

Try to indicate how the data is scrambled.

0
source share

Do you have any special attributes in your links? Could there be a title attribute rather than hidden quotes inside?

Something like this: <a href="http://some.site" title="My "correct" link">Link</a>

0
source share

All Articles