Already registered? Log in
Don't have an account? Register here
Integrating the SMTP2GO PHP Package for reliable and fast email delivery.
This library provides a simple way to send email via the SMTP2GO API and also access other endpoints in the API in a standard way.
For more information about API, see our API documentation.
We have created an excellent migration guide to help you move to SMTP2GO from your existing provider.
use SMTP2GO\ApiClient; use SMTP2GO\Service\Mail\Send as MailSend; $sendService = new MailSend( ['firstname.lastname@example.org', 'Sender Name'], [ ['email@example.com', 'Recipient Name'], ['firstname.lastname@example.org', 'Recipient Name 2'], ], 'Test Email', '<h1>Hello World</h1>' ); $sendService->addAddress('cc', 'email@example.com'); $sendService->addAddress('bcc', 'firstname.lastname@example.org'); $sendService->setAttachments(['/path/to/attachment', '/path/to/another_attachment']); $sendService->setInlines(['/path/to/inline_attachment', '/path/to/another_inline_attachment']); $sendService->addCustomHeader('Reply-To', 'email@example.com'); $apiClient = new ApiClient('api-YOURAPIKEY'); $success = $apiClient->consume($sendService); $responseBody = $apiClient->getResponseBody();
Integrating the SMTP2GO PHP Package should be an easy, quick and, hopefully, painless process.
You can access reports directly in your SMTP2GO dashboard, which will help you understand delivery successes and failures, tracking information and many more useful metrics. We’ve written some great articles outlining the features of your SMTP2GO account and we recommend taking the time to see everything we have to offer.
Should you need extra help from our award-winning support team, we are almost always available to assist. You can find support contact details in your SMTP2GO dashboard and information about retrieving your support PIN here.
Try SMTP2GO free for as long as you like:Try SMTP2GO Free → Paid plans available for over 1,000 emails/month.