نموذج اتصال JavaScript يرسل إلى البريد
Formgong team ·
نموذج اتصال JavaScript ما زال يحتاج عنوانًا لـ POST. استدع fetch، وأرسل الحقول، واقرأ رد JSON. يقبل Formgong هذا الاستدعاء بلا خادم لديك. لا تلزم مكتبة ولا مسار API ولا SMTP خاص. في الخطة المجانية Telegram فوري، والبريد ملخص يومي.
انسخ نموذج JavaScript هذا
<form id="fg-contact" action="https://formgong.com/submit" method="POST">
<input type="hidden" name="access_key" value="fk_your_access_key">
<input type="hidden" name="_lang" value="en">
<label>Name <input type="text" name="name" autocomplete="name" placeholder="Your name" required></label>
<label>Email <input type="email" name="email" autocomplete="email" placeholder="you@example.com" required></label>
<label>Message <textarea name="message" placeholder="How can we help?" required></textarea></label>
<div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
<label>Leave this field empty<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
<button type="submit">Send</button>
<p role="status"></p>
</form>
<script>
const form = document.querySelector("#fg-contact");
const status = form.querySelector("[role=status]");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const button = form.querySelector("button");
button.disabled = true;
const fields = Object.fromEntries(new FormData(form));
try {
const response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify(fields),
});
const result = await response.json();
status.textContent = result.message || (result.success ? "Sent. Thank you!" : "Could not send. Please try again.");
if (result.success) form.reset();
} catch {
status.textContent = "Connection failed. Please try again.";
} finally {
button.disabled = false;
}
});
</script><form id="fg-contact" action="https://formgong.com/submit" method="POST">
<input type="hidden" name="access_key" value="fk_your_access_key">
<input type="hidden" name="_lang" value="uk">
<label>Ім’я <input type="text" name="name" autocomplete="name" placeholder="Ваше ім’я" required></label>
<label>Email <input type="email" name="email" autocomplete="email" placeholder="you@example.com" required></label>
<label>Повідомлення <textarea name="message" placeholder="Чим ми можемо допомогти?" required></textarea></label>
<div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
<label>Залиште це поле порожнім<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
<button type="submit">Надіслати</button>
<p role="status"></p>
</form>
<script>
const form = document.querySelector("#fg-contact");
const status = form.querySelector("[role=status]");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const button = form.querySelector("button");
button.disabled = true;
const fields = Object.fromEntries(new FormData(form));
try {
const response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify(fields),
});
const result = await response.json();
status.textContent = result.message || (result.success ? "Надіслано. Дякуємо!" : "Не вдалося надіслати. Спробуйте ще раз.");
if (result.success) form.reset();
} catch {
status.textContent = "Немає з’єднання. Спробуйте ще раз.";
} finally {
button.disabled = false;
}
});
</script><form id="fg-contact" action="https://formgong.com/submit" method="POST">
<input type="hidden" name="access_key" value="fk_your_access_key">
<input type="hidden" name="_lang" value="pl">
<label>Imię <input type="text" name="name" autocomplete="name" placeholder="Twoje imię" required></label>
<label>E-mail <input type="email" name="email" autocomplete="email" placeholder="ty@example.com" required></label>
<label>Wiadomość <textarea name="message" placeholder="W czym możemy pomóc?" required></textarea></label>
<div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
<label>Pozostaw to pole puste<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
<button type="submit">Wyślij</button>
<p role="status"></p>
</form>
<script>
const form = document.querySelector("#fg-contact");
const status = form.querySelector("[role=status]");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const button = form.querySelector("button");
button.disabled = true;
const fields = Object.fromEntries(new FormData(form));
try {
const response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify(fields),
});
const result = await response.json();
status.textContent = result.message || (result.success ? "Wysłano. Dziękujemy!" : "Nie udało się wysłać. Spróbuj ponownie.");
if (result.success) form.reset();
} catch {
status.textContent = "Brak połączenia. Spróbuj ponownie.";
} finally {
button.disabled = false;
}
});
</script><form id="fg-contact" action="https://formgong.com/submit" method="POST">
<input type="hidden" name="access_key" value="fk_your_access_key">
<input type="hidden" name="_lang" value="tr">
<label>Ad <input type="text" name="name" autocomplete="name" placeholder="Adınız" required></label>
<label>E-posta <input type="email" name="email" autocomplete="email" placeholder="siz@ornek.com" required></label>
<label>Mesaj <textarea name="message" placeholder="Size nasıl yardımcı olabiliriz?" required></textarea></label>
<div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
<label>Bu alanı boş bırakın<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
<button type="submit">Gönder</button>
<p role="status"></p>
</form>
<script>
const form = document.querySelector("#fg-contact");
const status = form.querySelector("[role=status]");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const button = form.querySelector("button");
button.disabled = true;
const fields = Object.fromEntries(new FormData(form));
try {
const response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify(fields),
});
const result = await response.json();
status.textContent = result.message || (result.success ? "Gönderildi. Teşekkürler!" : "Gönderilemedi. Lütfen tekrar deneyin.");
if (result.success) form.reset();
} catch {
status.textContent = "Bağlantı kurulamadı. Lütfen tekrar deneyin.";
} finally {
button.disabled = false;
}
});
</script><form id="fg-contact" action="https://formgong.com/submit" method="POST">
<input type="hidden" name="access_key" value="fk_your_access_key">
<input type="hidden" name="_lang" value="es">
<label>Nombre <input type="text" name="name" autocomplete="name" placeholder="Tu nombre" required></label>
<label>Correo electrónico <input type="email" name="email" autocomplete="email" placeholder="tu@ejemplo.com" required></label>
<label>Mensaje <textarea name="message" placeholder="¿En qué podemos ayudarte?" required></textarea></label>
<div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
<label>Deja este campo vacío<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
<button type="submit">Enviar</button>
<p role="status"></p>
</form>
<script>
const form = document.querySelector("#fg-contact");
const status = form.querySelector("[role=status]");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const button = form.querySelector("button");
button.disabled = true;
const fields = Object.fromEntries(new FormData(form));
try {
const response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify(fields),
});
const result = await response.json();
status.textContent = result.message || (result.success ? "Enviado. ¡Gracias!" : "No se pudo enviar. Inténtalo de nuevo.");
if (result.success) form.reset();
} catch {
status.textContent = "Error de conexión. Inténtalo de nuevo.";
} finally {
button.disabled = false;
}
});
</script><form id="fg-contact" action="https://formgong.com/submit" method="POST">
<input type="hidden" name="access_key" value="fk_your_access_key">
<input type="hidden" name="_lang" value="fr">
<label>Nom <input type="text" name="name" autocomplete="name" placeholder="Votre nom" required></label>
<label>E-mail <input type="email" name="email" autocomplete="email" placeholder="vous@exemple.com" required></label>
<label>Message <textarea name="message" placeholder="Comment pouvons-nous vous aider ?" required></textarea></label>
<div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
<label>Laissez ce champ vide<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
<button type="submit">Envoyer</button>
<p role="status"></p>
</form>
<script>
const form = document.querySelector("#fg-contact");
const status = form.querySelector("[role=status]");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const button = form.querySelector("button");
button.disabled = true;
const fields = Object.fromEntries(new FormData(form));
try {
const response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify(fields),
});
const result = await response.json();
status.textContent = result.message || (result.success ? "Envoyé. Merci !" : "Échec de l’envoi. Veuillez réessayer.");
if (result.success) form.reset();
} catch {
status.textContent = "Connexion impossible. Veuillez réessayer.";
} finally {
button.disabled = false;
}
});
</script><form id="fg-contact" action="https://formgong.com/submit" method="POST">
<input type="hidden" name="access_key" value="fk_your_access_key">
<input type="hidden" name="_lang" value="pt">
<label>Nome <input type="text" name="name" autocomplete="name" placeholder="O seu nome" required></label>
<label>E-mail <input type="email" name="email" autocomplete="email" placeholder="voce@exemplo.com" required></label>
<label>Mensagem <textarea name="message" placeholder="Como podemos ajudar?" required></textarea></label>
<div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
<label>Deixe este campo vazio<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
<button type="submit">Enviar</button>
<p role="status"></p>
</form>
<script>
const form = document.querySelector("#fg-contact");
const status = form.querySelector("[role=status]");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const button = form.querySelector("button");
button.disabled = true;
const fields = Object.fromEntries(new FormData(form));
try {
const response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify(fields),
});
const result = await response.json();
status.textContent = result.message || (result.success ? "Enviado. Obrigado!" : "Não foi possível enviar. Tente novamente.");
if (result.success) form.reset();
} catch {
status.textContent = "Falha na ligação. Tente novamente.";
} finally {
button.disabled = false;
}
});
</script><form id="fg-contact" action="https://formgong.com/submit" method="POST">
<input type="hidden" name="access_key" value="fk_your_access_key">
<input type="hidden" name="_lang" value="ar">
<label>الاسم <input type="text" name="name" autocomplete="name" placeholder="اسمك" required></label>
<label>البريد الإلكتروني <input type="email" name="email" autocomplete="email" placeholder="you@example.com" required></label>
<label>الرسالة <textarea name="message" placeholder="كيف يمكننا مساعدتك؟" required></textarea></label>
<div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
<label>اترك هذا الحقل فارغًا<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
<button type="submit">إرسال</button>
<p role="status"></p>
</form>
<script>
const form = document.querySelector("#fg-contact");
const status = form.querySelector("[role=status]");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const button = form.querySelector("button");
button.disabled = true;
const fields = Object.fromEntries(new FormData(form));
try {
const response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify(fields),
});
const result = await response.json();
status.textContent = result.message || (result.success ? "تم الإرسال. شكرًا لك!" : "تعذّر الإرسال. يرجى المحاولة مرة أخرى.");
if (result.success) form.reset();
} catch {
status.textContent = "فشل الاتصال. يرجى المحاولة مرة أخرى.";
} finally {
button.disabled = false;
}
});
</script><form id="fg-contact" action="https://formgong.com/submit" method="POST">
<input type="hidden" name="access_key" value="fk_your_access_key">
<input type="hidden" name="_lang" value="he">
<label>שם <input type="text" name="name" autocomplete="name" placeholder="השם שלך" required></label>
<label>אימייל <input type="email" name="email" autocomplete="email" placeholder="you@example.com" required></label>
<label>הודעה <textarea name="message" placeholder="איך נוכל לעזור?" required></textarea></label>
<div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
<label>השאירו שדה זה ריק<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
<button type="submit">שליחה</button>
<p role="status"></p>
</form>
<script>
const form = document.querySelector("#fg-contact");
const status = form.querySelector("[role=status]");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const button = form.querySelector("button");
button.disabled = true;
const fields = Object.fromEntries(new FormData(form));
try {
const response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify(fields),
});
const result = await response.json();
status.textContent = result.message || (result.success ? "נשלח. תודה!" : "השליחה נכשלה. נא לנסות שוב.");
if (result.success) form.reset();
} catch {
status.textContent = "אין חיבור. נא לנסות שוב.";
} finally {
button.disabled = false;
}
});
</script><form id="fg-contact" action="https://formgong.com/submit" method="POST">
<input type="hidden" name="access_key" value="fk_your_access_key">
<input type="hidden" name="_lang" value="hi">
<label>नाम <input type="text" name="name" autocomplete="name" placeholder="आपका नाम" required></label>
<label>ईमेल <input type="email" name="email" autocomplete="email" placeholder="you@example.com" required></label>
<label>संदेश <textarea name="message" placeholder="हम आपकी कैसे मदद कर सकते हैं?" required></textarea></label>
<div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
<label>इस फ़ील्ड को खाली छोड़ें<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
<button type="submit">भेजें</button>
<p role="status"></p>
</form>
<script>
const form = document.querySelector("#fg-contact");
const status = form.querySelector("[role=status]");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const button = form.querySelector("button");
button.disabled = true;
const fields = Object.fromEntries(new FormData(form));
try {
const response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify(fields),
});
const result = await response.json();
status.textContent = result.message || (result.success ? "भेज दिया गया। धन्यवाद!" : "भेजा नहीं जा सका। कृपया फिर से कोशिश करें।");
if (result.success) form.reset();
} catch {
status.textContent = "कनेक्शन विफल। कृपया फिर से कोशिश करें।";
} finally {
button.disabled = false;
}
});
</script><form id="fg-contact" action="https://formgong.com/submit" method="POST">
<input type="hidden" name="access_key" value="fk_your_access_key">
<input type="hidden" name="_lang" value="ja">
<label>お名前 <input type="text" name="name" autocomplete="name" placeholder="山田 太郎" required></label>
<label>メールアドレス <input type="email" name="email" autocomplete="email" placeholder="you@example.com" required></label>
<label>メッセージ <textarea name="message" placeholder="ご用件をご記入ください" required></textarea></label>
<div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
<label>この欄は空のままにしてください<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
<button type="submit">送信</button>
<p role="status"></p>
</form>
<script>
const form = document.querySelector("#fg-contact");
const status = form.querySelector("[role=status]");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const button = form.querySelector("button");
button.disabled = true;
const fields = Object.fromEntries(new FormData(form));
try {
const response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify(fields),
});
const result = await response.json();
status.textContent = result.message || (result.success ? "送信しました。ありがとうございます。" : "送信できませんでした。もう一度お試しください。");
if (result.success) form.reset();
} catch {
status.textContent = "接続できませんでした。もう一度お試しください。";
} finally {
button.disabled = false;
}
});
</script><form id="fg-contact" action="https://formgong.com/submit" method="POST">
<input type="hidden" name="access_key" value="fk_your_access_key">
<input type="hidden" name="_lang" value="de">
<label>Name <input type="text" name="name" autocomplete="name" placeholder="Ihr Name" required></label>
<label>E-Mail <input type="email" name="email" autocomplete="email" placeholder="name@beispiel.de" required></label>
<label>Nachricht <textarea name="message" placeholder="Wie können wir Ihnen helfen?" required></textarea></label>
<div aria-hidden="true" style="position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)">
<label>Lassen Sie dieses Feld leer<input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label>
</div>
<button type="submit">Senden</button>
<p role="status"></p>
</form>
<script>
const form = document.querySelector("#fg-contact");
const status = form.querySelector("[role=status]");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const button = form.querySelector("button");
button.disabled = true;
const fields = Object.fromEntries(new FormData(form));
try {
const response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify(fields),
});
const result = await response.json();
status.textContent = result.message || (result.success ? "Gesendet. Vielen Dank!" : "Das Senden ist fehlgeschlagen. Bitte versuchen Sie es erneut.");
if (result.success) form.reset();
} catch {
status.textContent = "Die Verbindung ist fehlgeschlagen. Bitte versuchen Sie es erneut.";
} finally {
button.disabled = false;
}
});
</script>أرسل FormData بدل JSON
<script>
const form = document.querySelector("#fg-contact");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const status = form.querySelector("[role=status]");
try {
const response = await fetch("https://formgong.com/submit", {
method: "POST",
headers: { Accept: "application/json" },
body: new FormData(form),
});
const result = await response.json();
status.textContent = result.message || (result.success ? "تم الإرسال. شكرًا لك!" : "تعذّر الإرسال. يرجى المحاولة مرة أخرى.");
if (!result.success) return;
form.reset();
} catch {
status.textContent = "فشل الاتصال. يرجى المحاولة مرة أخرى.";
}
});
</script>استدعاء fetch فقط إذا كان النموذج في الصفحة
async function onSubmit(event) {
event.preventDefault();
const fields = Object.fromEntries(new FormData(event.currentTarget));
const response = await fetch("https://formgong.com/submit", {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
// _lang: language of Formgong messages and the autoreply (multilingual site: document.documentElement.lang).
body: JSON.stringify({ _lang: "ar", ...fields, access_key: "fk_your_access_key" }),
});
const result = await response.json();
if (!result.success) throw new Error(result.message || "تعذّر الإرسال. يرجى المحاولة مرة أخرى.");
return result.message; // localized "Sent. Thank you!"
}كيف تعمل النماذج في JavaScript
الناس يبحثون عن نموذج JavaScript يرسل البريد، لا عن نموذج fetch. fetch مجرد استدعاء المتصفح الذي ينفذ POST. لا يلزم EmailJS ولا Axios ولا مسار خادم.
أرسل ترويسة Accept بقيمة application/json، وإلا يرد الطرف بتحويل كما في النموذج العادي. fetch الفاشل يرمي خطأ. الطلب المرفوض يعود و success فيه false مع نص يمكنك إظهاره.
الإعداد في JavaScript
- أنشئ نموذجًا في Formgong وانسخ المفتاح.
- الصق الرمز أعلاه. هو نموذج ونص قصير: async و await و JSON و try catch لأخطاء الشبكة.
- اترك حقل الفخ فارغًا وخارج الشاشة. إذا ملأه روبوت، يُحفظ الطلب كمزعج ولا يُسلّم.
- يعطل النص الزر أثناء الطلب ثم يظهر نص الرد. النجاح يفرغ النموذج.
- افتح الصفحة الحية وأرسل تجربة. راجع الصندوق، ثم اربط Telegram إذا أردت تنبيهًا على الهاتف.
طرق إرسال نموذج JavaScript
| الخيار | ما تشغّله أنت | ما تحصل عليه |
|---|---|---|
| mailto: | لا شيء على خادم. يفتح البريد. | رسالة فقط إذا أرسل الزائر. على الهاتف ينكسر هذا بسهولة. |
| مسار API خاص | خادم و SMTP وسر. | بريد تتحكم به. ويبقى لديك المزعج والتوقف والرمز. |
| EmailJS | نصهم في الصفحة. | بريد عبر خدمتهم. لا سعر في هذا الصف. لم يُراجع السعر ذلك اليوم. |
| Formspree | لا شيء. المتصفح يرسل إلى Formspree. | بريد ولوحة. المجاني 50 إرسالًا في الشهر. Personal يكلف 15 دولارًا في الشهر. |
| Formgong | لا شيء. fetch يرسل إلى Formgong. | Telegram فورًا. في Free البريد ملخص يومي. 300 إرسال في الشهر، والبيانات في الاتحاد الأوروبي. |
أسعار Formspree من formspree.io/plans في 2026-10-06. حدود Formgong من الرمز. EmailJS يظهر في هذا البحث. لم يُراجع سعره ذلك اليوم. رد Web3Forms.com بـ HTTP 403، لذا ليس في الجدول.
الأسعار · نموذج اتصال HTML يرسل إلى البريد
حزمة المكوّنات: npm install @formgong/core (npm: @formgong/core)
أضف إلى مشروع قائم: npx formgong init (npm: formgong)
fetch أم مكتبة أم خادمك؟
استخدم هذه الصفحة إذا كان النموذج JavaScript عاديًا أو قطعة صغيرة أو نافذة. يبقى الزائر في الصفحة.
استخدم HTML العادي إذا قد يكون JavaScript مغلقًا. النموذج أعلاه ما زال فيه action، فيعمل إن لم يجر النص.
اكتب خادمك فقط إذا كان الطلب يغيّر بيانات في تطبيقك. EmailJS يرسل عبر نصه. Formgong طلب POST واحد.
أسئلة وأجوبة
هل يرسل JavaScript النموذج إلى البريد بلا خادم؟
المتصفح لا يتحدث SMTP. يمكنه إرسال الحقول بـ POST إلى خلفية. تلك الخلفية ترسل البريد. أنت لا تشغّل خادمًا لهذا النموذج.
هل أرسل FormData أم JSON؟
JSON يناسب حقول النص. FormData يناسب إذا كان النموذج موجودًا وإذا أرسلت ملفاتًا. كلاهما يصل إلى الصندوق نفسه. لا تضع Content-Type بنفسك مع FormData.
لماذا أحصل على تحويل بدل JSON؟
POST النموذج العادي يعيد تحويلًا. للحصول على JSON أرسل ترويسة Accept بقيمة application/json. ثم اقرأ success والنص.
كيف أعالج الأخطاء؟
fetch الفاشل يرمي خطأ. هذا خطأ شبكة. الطلب المرفوض يعيد JSON و success فيه false. أظهر هذا النص وأبق ما كتبه الشخص.
هل أحتاج EmailJS أو مكتبة أخرى؟
لا. fetch موجود في المتصفح. المكتبة مناسبة إذا كنت تستخدمها. أرسل الحقول نفسها والترويسات نفسها.