Offizielle SDKs, um toSend in Ihre Anwendungen einzubinden.
Verfügbare SDKs
| Sprache | Paket | Installation |
|---|---|---|
| Node.js | tosend | npm install tosend |
| Python | tosend | pip install tosend |
| Go | github.com/tosend/tosend-go | go get github.com/tosend/tosend-go |
| Laravel | tosend/tosend-laravel | composer require tosend/tosend-laravel |
| PHP | tosend/tosend-php | composer require tosend/tosend-php |
Schnellstart
Wählen Sie Ihre Sprache:
import { ToSend } from 'tosend';
const tosend = new ToSend('tsend_your_api_key');
await tosend.send({
from: { email: 'hello@yourdomain.com', name: 'Your App' },
to: [{ email: 'user@example.com' }],
subject: 'Welcome!',
html: '<h1>Hello!</h1>',
});
from tosend import ToSend
client = ToSend("tsend_your_api_key")
response = client.send(
from_address={"email": "hello@yourdomain.com", "name": "Your App"},
to=[{"email": "user@example.com"}],
subject="Welcome!",
html="<h1>Hello!</h1>",
)
client := tosend.New("tsend_your_api_key")
resp, err := client.Send(&tosend.SendEmailRequest{
From: tosend.Address{Email: "hello@yourdomain.com", Name: "Your App"},
To: []tosend.Address{{Email: "user@example.com"}},
Subject: "Welcome!",
HTML: "<h1>Hello!</h1>",
})
use ToSend\Laravel\Facades\ToSend;
ToSend::send([
'from' => ['email' => 'hello@yourdomain.com', 'name' => 'Your App'],
'to' => [['email' => 'user@example.com']],
'subject' => 'Welcome!',
'html' => '<h1>Hello!</h1>',
]);
$tosend = new ToSend\Api('tsend_your_api_key');
$response = $tosend->send([
'from' => ['email' => 'hello@yourdomain.com', 'name' => 'Your App'],
'to' => [['email' => 'user@example.com']],
'subject' => 'Welcome!',
'html' => '<h1>Hello!</h1>',
]);
Gemeinsame Funktionen
Alle SDKs unterstützen:
- E-Mail senden: transaktionale E-Mails mit HTML und Reintext senden
- Sammelversand: mehrere E-Mails in einer Anfrage senden
- Anhänge: Dateianhänge an E-Mails hängen
- CC/BCC: Empfänger in Kopie und Blindkopie
- Reply-To: eigene Antwortadressen
- Kontodaten: Kontodaten und Domainstatus abrufen
- Fehlerbehandlung: ausführliche Fehlerantworten mit Validierungsmeldungen
Quellcode
Alle SDKs sind Open Source und auf GitHub verfügbar: