Zum Inhalt springen

Live-Demo

Ein echtes Formular. Eine echte E-Mail. Probieren Sie es aus.

Wählen Sie Ihr Framework. Links sehen Sie die vollständige Komponente, rechts genau dieselbe Komponente, die gegen die echte Frontmail-API läuft. Senden Sie eine Nachricht und verfolgen Sie, wie sie zugestellt wird.

React Native

Live-Komponente · React

Diese Demo ist begrenzt. Nachrichten gehen an das Postfach des Frontmail-Teams, nie an die Adresse, die Sie eingeben.

Quellcode: InquiryForm.tsx

import { FrontmailForm, FrontmailProvider } from '@frontmail/react';
import type { FrontmailError, SendResult } from '@frontmail/react';

const options = {
  publicKey: 'pk_••••••••',
};

interface Props {
  onSuccess?: (result: SendResult) => void;
  onError?: (error: FrontmailError) => void;
}

export function InquiryForm({ onSuccess, onError }: Props) {
  return (
    <FrontmailProvider options={options}>
      <FrontmailForm
        serviceId="YOUR_SERVICE_ID"
        templateId="tpl_01m3hk61yth7gefvf2s5h7gefv"
        turnstileSiteKey="YOUR_TURNSTILE_SITE_KEY"
        onSuccess={onSuccess}
        onError={onError}
      >
        {({ status }) => (
          <>
            <label>
              Name
              <input name="name" autoComplete="name" required maxLength={200} />
            </label>
            <label>
              E-Mail
              <input name="email" type="email" autoComplete="email" required />
            </label>
            <label>
              Nachricht
              <textarea name="message" rows={4} required minLength={2} maxLength={5000} />
            </label>
            <button type="submit" disabled={status === 'sending'}>
              {status === 'sending' ? 'Wird gesendet…' : 'Nachricht senden'}
            </button>
          </>
        )}
      </FrontmailForm>
    </FrontmailProvider>
  );
}

Der öffentliche Schlüssel ist hier maskiert. Verwenden Sie Ihren eigenen aus dem Dashboard – im Frontend-Code ist er sicher, weil erlaubte Websites und CAPTCHA ihn schützen.

Bereit für Ihre Website?

Legen Sie ein kostenloses Konto an, verbinden Sie den E-Mail-Dienst, den Sie bereits nutzen, und wählen Sie eine Vorlage aus der Galerie. Die gesamte Einrichtung dauert etwa eine Viertelstunde.