Autowired setup & reliable delivery
Add email sending to your Symfony application in minutes with Sidemail's official PHP SDK and developer‑friendly API. Sidemail takes care of deliverability, SPF/DKIM/DMARC, templates, and infrastructure so your Symfony controllers can send reliable, production‑ready emails with minimal setup.
Get startedRead API docsuse Sidemail\Sidemail;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Attribute\Route;
class RegistrationController
{
#[Route('/register', methods: ['POST'])]
public function register(Sidemail $sidemail): JsonResponse
{
// ... create user
$sidemail->sendEmail([
'toAddress' => $user->getEmail(),
'fromAddress' => '[email protected]',
'fromName' => 'Your App',
'templateName' => 'Welcome',
'templateProps' => ['firstName' => $user->getFirstName()],
]);
return new JsonResponse(['status' => 'registered']);
}
}Start sending emails from your Symfony app in three steps:
Add Sidemail to your Symfony project via Composer:
composer require sidemail/sidemailRegister the Sidemail client in config/services.yaml so Symfony can autowire it into your controllers. The SDK reads SIDEMAIL_API_KEY from your environment automatically.
# config/services.yaml
services:
Sidemail\Sidemail:
autowire: trueType-hint Sidemail in your controller action and call sendEmail. Pass the recipient, sender, and template or content. That's it.
use Sidemail\Sidemail;
use Symfony\Component\Routing\Attribute\Route;
class RegistrationController
{
#[Route('/register', methods: ['POST'])]
public function register(Sidemail $sidemail): JsonResponse
{
// ... create user
$sidemail->sendEmail([
'toAddress' => $user->getEmail(),
'fromAddress' => '[email protected]',
'fromName' => 'Your App',
'templateName' => 'Welcome',
'templateProps' => ['firstName' => $user->getFirstName()],
]);
return new JsonResponse(['status' => 'registered']);
}
}Key features & perks
With Sidemail, you can send any transactional email from Symfony. Here are a few examples with code:
// Symfony: Send an account verification email
#[Route('/register', methods: ['POST'])]
public function register(Sidemail $sidemail): JsonResponse
{
// ... create user, generate token
$sidemail->sendEmail([
'toAddress' => $user->getEmail(),
'fromAddress' => '[email protected]',
'fromName' => 'Your App',
'templateName' => 'Email Verification',
'templateProps' => [
'verifyUrl' => 'https://yourapp.com/verify?token=' . $token,
],
]);
return new JsonResponse(['status' => 'registered']);
}Send a sign-up verification email with a one-time link or code to confirm the user's address.
// Symfony: Send a payment receipt email
$sidemail->sendEmail([
'toAddress' => $user->getEmail(),
'fromAddress' => '[email protected]',
'fromName' => 'Your App',
'templateName' => 'Payment Receipt',
'templateProps' => [
'userName' => $user->getFirstName(),
'amount' => '$19.99',
'date' => (new \DateTime())->format('M j, Y'),
],
]);Send a receipt, invoice, or generic notification to your user.
templateProps to dynamically populate Sidemail's receipt and invoice templates with your data.// Symfony: Schedule a welcome email for 1 hour from now
$sidemail->sendEmail([
'toAddress' => '[email protected]',
'fromAddress' => '[email protected]',
'fromName' => 'Your App',
'templateName' => 'Welcome',
'templateProps' => ['firstName' => 'Alex'],
'scheduledAt' => (new DateTime('+1 hour'))->format(DateTime::ATOM),
]);Schedule a welcome email to be delivered later, for instance one hour after the user signs up.
scheduledAt field with an ISO timestamp to control exactly when the email is sent.// Symfony: Send a password reset email with Markdown
$markdown = file_get_contents(
$this->getParameter('kernel.project_dir') .
'/templates/emails/password-reset.md'
);
$sidemail->sendEmail([
'toAddress' => '[email protected]',
'markdown' => $markdown,
'templateProps' => [
'firstName' => 'Alex',
'resetLink' => 'https://yourapp.com/reset?token=abc123xyz',
'expiresIn' => '30 minutes',
],
]);---
subject: "Reset your password"
fromAddress: "[email protected]"
fromName: "Your App Security"
---
Hi {firstName}, we received a request to reset your password.
[$btn Reset password]({resetLink})
This link expires in {expiresIn}.Sidemail's API lets you write email content in Markdown, which is automatically converted into pixel‑perfect, responsive emails that render beautifully in every inbox and on every device. Each email is branded with your logo and styled to match your project's email design.
.md file under your Symfony templates directorytemplateProps(such as resetLink and expiresIn), which map directly to variables in your markdown.Deliverability best practices
SPF and DKIM are authentication protocols that verify your emails are legitimately sent from your domain. And DMARC builds on both by instructing mail servers how to handle messages that fail those checks. Together, they are 3 critical factors for inbox delivery and sender reputation.
Sidemail automatically handles SPF, DKIM, and DMARC setup for you, so your Symfony application sends authenticated, best‑practice‑compliant emails right out of the gate.




The simplest way to build emails
Sidemail's no‑code email editor is the fastest way to create responsive email templates that render correctly across every email client and device. No HTML knowledge needed. Add your logo and brand colors, and you're good to go.
Need something faster? Sidemail includes a library of production‑ready templates for the most common use cases – password resets, welcome emails, receipts, and more. Whether you're starting from scratch or customizing a premade template, your emails are guaranteed to look great everywhere.
Learn moreDeveloper‑friendly formatting
Maintaining HTML emails by hand is tedious, especially when you just need to send clean, readable content.
Sidemail lets you write your email body in Markdown and automatically converts it into a responsive, well‑styled HTML email. You get smart formatting – headings, lists, links, and code blocks – without worrying about broken layouts or cross‑client rendering issues.
Perfect for transactional emails sent from your Symfony app – clean content, rapid authoring, and zero HTML to maintain.
Learn more
Ready to send transactional emails from your Symfony application? With Sidemail's API and premade templates, you can integrate in minutes and deliver emails reliably.
Start free trialThe simplest way to send email from a Symfony app is by using an email API like Sidemail. Install the PHP SDK (composer require sidemail/sidemail), register it in config/services.yaml for autowiring, and call $sidemail->sendEmail() in your controller. No SMTP setup or Symfony Mailer configuration needed. Sidemail handles authentication, formatting, and deliverability.
Yes. Register the Sidemail\Sidemail class in services.yaml with autowire enabled and Symfony injects it into any controller or service automatically. No extra bundles or factories needed.
Absolutely. Since Sidemail is a plain PHP class that's autowired, you can inject it into any Event Subscriber or Listener. For example, listen to a UserRegisteredEvent and send a welcome email from the subscriber instead of the controller. This keeps your email logic decoupled from your request handling.
In the Sidemail dashboard, pick a premade template or create your own with the drag‑and‑drop editor. In your Symfony controller, reference the template by templateName and pass dynamic data via templateProps. Sidemail merges the data and delivers a well‑formatted email. No Twig + Inky + CSS inlining is necessary.
No. Sidemail's PHP SDK makes direct API calls, bypassing Symfony Mailer entirely. You don't need to configure an SMTP transport or install the Mailer component. A single Composer package and your API key are all that's required.
Wrap your $sidemail->sendEmail() call in a try/catch block and catch Sidemail\SidemailException. The exception provides the HTTP status, error code, and a human‑readable message. Log it with Symfony's Logger service and return an appropriate response.