The Official turboSMTP C#, .NetStandard, .NetCore SDK - enables .Net Developers to work with turboSMTP API efficiently.
- Release notes
- Getting Started
- Quick start with TurboSMTP Client
- Usage
- Contribute
- Troubleshooting
- About
- Support
- License
Changes to the SDK beginning with version 2.0.0 (August 2024) are tracked in [CHANGELOG.md][changes-file].
- .NET Framework 4.8+.
- A turboSMTP account, sign up for free to send up to 6.000 FREE emails per month (No Obligation - No Credit card required).
Create your API Key from turboSMTP Dashboard.
turboSMTP allows sending and receiving an email worldwide, for better sending experience, turboSMTP offers 2 regions.
For european region use the sending URL:
https://api.eu.turbo-smtp.com/api/v2
For other regions use the sending URL:
https://api.turbo-smtp.com/api/v2
https://api.turbo-smtp.com/api/v2
In order to facilitate construction and usage of TurboSMTPClientConfiguration, it´s been built as a combination of Builder + Singleton design patterns:
As stated above, TurboSMTPClientConfiguration uses a builder design pattern that allows to setup your ConsumerKey and Secret, ServerURL and SendServerURL, and your Timezone that will be used to consume time sensitive data, like when filtering data by dates.
using System.Configuration;
using TurboSMTP;
namespace ConsoleApp
{
internal class Program
{
static void Main(string[] args)
{
var config = new TurboSMTPClientConfiguration.Builder()
.SetConsumerKey(ConfigurationManager.AppSettings["ConsumerKey"])
.SetConsumerSecret(ConfigurationManager.AppSettings["ConsumerSecret"])
.SetServerURL(ConfigurationManager.AppSettings["ServerUrl"])
.SetSendServerURL(ConfigurationManager.AppSettings["SendServerUrl"])
.SetTimeZone("-03:00")
.Build();
}
}
}As stated above, TurboSMTPClientConfiguration uses a singleton design pattern, once it´s been already setup once (it´s suggested you setup anytime during your application initialization), you can simply access it´s Instance property as:
var configuration = TurboSMTPClientConfiguration.InstanceIn order to create a TurboSMTPClient simply pass a TurboSMTPClientConfiguration to it´s constructor as:
var TSClient = new TurboSMTPClient(TurboSMTPClientConfiguration.Instance);using System.Threading.Tasks;
using TurboSMTP;
using TurboSMTP.Domain;
namespace ConsoleApp
{
internal class Program
{
static async Task Main(string[] args)
{
//Create an Email Message
var emailMessage = new EmailMessage.Builder()
.SetFrom("sender@yourdomain.com")
.AddTo("recipient@domain.com")
.SetSubject("Hello World Simple Email")
.SetHtmlContent("This email has been sent using <b>turboSMTP SDK</b>.")
.Build();
//Create a TurboSMTPClient Instance
var TSClient = new TurboSMTPClient(TurboSMTPClientConfiguration.Instance);
//Send your Email Message
var result = await TSClient.Emails.SendAsync(emailMessage);
}
}
}After executing the above code, result.Message should be OK and MessageID should contain a reference number to your sending operation, and you should have an email in the inbox of the to recipient. You can check the status of your email in the UI, or using TurboSMTPClient.Relays.QueryAsync() method. Alternatively, we can post events to a URL of your choice using our Event Webhooks. This gives you information about the events that occur as turboSMTP processes your email.
Thank you for considering contributing to our SDK! We welcome all forms of contributions, including bug reports and feature requests.
Your feedback is invaluable in helping us improve and expand our SDK, please refere to our CONTRIBUTING guide for details.
For any inquiries, you can contact us at the following email address:
Email: sdk@turbo-smtp
Quick links:
Please see our troubleshooting guide for common library issues.
turboSMTP-csharp is maintained and funded by Turbo SMTP Company. The names and logos for turboSMTP-csharp are trademarks of TurboSMTP Company.
If you need help using Turbo SMTP SDK, please check the TurboSMTP Support Help Center.
This SDK is licensed under the MIT License - see the LICENSE file for details.