أمثلة على التفاعل مع الرسائل الإلكترونية

في ما يلي عدة أمثلة على رسائل التفاعل الصالحة وغير الصالحة عبر البريد الإلكتروني.

سارٍ في الفترة multipart/alternative

تتضمّن التفاعلات مع الرسائل الإلكترونية عادةً ثلاثة أجزاء:

  • text/plain: هي نسخة الرسالة بنص عادي.
  • text/vnd.google.email-reaction+json: جزء التفاعل
  • text/html: إصدار HTML من الرسالة

وفي ما يلي مثال لذلك:

From: test@google.com
Message-ID: <884457408.1.1697791227669@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: multipart/alternative;
        boundary="----=_Part_0_2012232625.1697791227635"

------=_Part_0_2012232625.1697791227635
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Text body content
------=_Part_0_2012232625.1697791227635
Content-Type: text/vnd.google.email-reaction+json; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=99=83","version":1}
------=_Part_0_2012232625.1697791227635
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<h1>HTML body content</h1>
------=_Part_0_2012232625.1697791227635--

جزء واحد صالح من الجسم

يمكن أن تتضمّن تفاعلات الرسائل الإلكترونية جزءًا واحدًا فقط من الجسم، مثل:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=99=83","version":1}

يُرجى العِلم أنّ Content-Transfer-Encoding يمكن أن يكون أي ترميز عادي:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json
Content-Transfer-Encoding: base64

ewogICJlbW9qaSI6ICLwn46JIiwKICAidmVyc2lvbiI6IDEKfQ==

بالنسبة إلى عمليات الترميز الثنائية، مثل base64، يجب ترميز JSON باستخدام UTF-8.

المدة الصالحة للاشتراك المتداخل multipart/alternative في multipart/related

إذا كانت ردة الفعل على رسالة تحتوي على مرفقات مضمّنة، من الممكن إنشاء رسالة تتضمّن جزءًا من نص multipart/related يحتوي على المرفقات بالإضافة إلى جزء multipart/alternative مثل المثال السابق.

From: test@google.com
Message-ID: <913190639.2.1697793303663@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: multipart/related;
        boundary="----=_Part_0_2012232625.1697793303618"

------=_Part_0_2012232625.1697793303618
Content-Type: multipart/alternative;
        boundary="----=_Part_1_984213526.1697793303621"

------=_Part_1_984213526.1697793303621
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Text body content
------=_Part_1_984213526.1697793303621
Content-Type: text/vnd.google.email-reaction+json
Content-Transfer-Encoding: base64

ewogICJlbW9qaSI6ICLwn46JIiwKICAidmVyc2lvbiI6IDEKfQ==
------=_Part_1_984213526.1697793303621
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<h1>HTML body content</h1>
------=_Part_1_984213526.1697793303621--

------=_Part_0_2012232625.1697793303618
Content-Type: image/png
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="1x1.png"

iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMA
QObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=
------=_Part_0_2012232625.1697793303618--

(يُرجى العِلم أنّ جزء النص multipart/related يجب أن يتضمّن حقولاً أخرى كما هو محدّد في RFC2387، ولكنّ هذه الحقول غير مهمة لتحديد ما إذا كانت التفاعلات مع الرسائل الإلكترونية صالحة أم لا).

تنسيق البيانات غير صالح في JSON

التفاعل التالي غير صالح لأنّ JSON لا يتضمّن قوس الإغلاق:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=99=83","version":1

التفاعل التالي غير صالح لأنّ JSON يتضمّن فاصلة لاحقة:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=99=83","version":1,}

الحقل version غير صالح

التفاعل التالي غير صالح لأنّه لا يتضمّن الحقل version:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=99=83"}

التفاعل التالي غير صالح لأنّ الحقل version ليس 1:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=99=83","version":2}

الحقل emoji غير صالح

التفاعل التالي غير صالح لأنّ الحقل emoji فارغ:

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"","version":1}

التفاعل التالي غير صالح لأنّ الحقل emoji لا يحتوي على إيموجي صالح.

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"A","version":1}

التفاعل التالي غير صالح لأنّه لا يتضمّن رمز الإيموجي ❤ بين حرفَي ZWJ. يُرجى العِلم أنّ الحرف = في نهاية سطر المحتوى الأول يمثّل فاصل أسطر ليّنًا في ترميز Quoted-Printable.

From: test+no-reply@google.com
Message-ID: <940553268.0.1697791227697@mail.google.com>
Subject: subject
MIME-Version: 1.0
In-Reply-To: <2938749223.1.39847234@mail.google.com>
Content-Type: text/vnd.google.email-reaction+json; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

{"emoji":"=F0=9F=91=A9=F0=9F=8F=BC=E2=80=8D=E2=80=8D=F0=9F=91=A8=F0=9F=8F=BE",=
"version":1}