# LeadMail SDK for Laravel Laravel package for sending emails and verifying email addresses through the [leadMail](https://mail.leadmagnet.dev) service. ## Requirements - PHP 8.2+ - Laravel 11 or 12 ## Installation ```bash composer require leadm/leadmail ``` Publish the config file: ```bash php artisan vendor:publish --provider="LeadM\LeadMail\LeadMailServiceProvider" ``` ## Configuration Add these to your `.env`: ```env LEADMAIL_URL=https://mail.leadmagnet.dev LEADMAIL_TOKEN=lm_your_api_token_here ``` Optional settings: ```env LEADMAIL_TIMEOUT=30 LEADMAIL_VERIFY_SSL=true LEADMAIL_AUTO_TENANT=true ``` ## Usage ### Send Emails via Mail Driver Set `leadmail` as your mail driver in `.env`: ```env MAIL_MAILER=leadmail ``` Then use Laravel's `Mail` facade as usual: ```php Mail::to('user@example.com')->send(new WelcomeMail()); ``` ### Send Emails via API ```php LeadMail::sendEmail([ 'from' => ['email' => 'hello@yourdomain.com', 'name' => 'Your App'], 'to' => [['email' => 'user@example.com', 'name' => 'User']], 'subject' => 'Welcome!', 'html_body' => '