טופס יצירת קשר ב-JavaScript ששולח לדואר
Formgong team ·
טופס יצירת קשר ב-JavaScript עדיין צריך כתובת ל-POST. קראו ל-fetch, שלחו את השדות וקראו את תשובת JSON. Formgong מקבל את הקריאה בלי שרת שלכם. אין צורך בספרייה או במסלול API. במסלול החינמי Telegram מיידי, והדואר הוא תקציר יומי. אין צורך ב-SMTP משלכם.
העתיקו את טופס ה-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: "he", ...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 כבר בדפדפן. ספרייה מתאימה אם אתם כבר משתמשים בה. שלחו את אותם שדות ואותן כותרות.