Over THOUSANDS of developers trust SocketLabs to deliver billions
of emails every month.
SocketLabs is Built for Developers, By Developers
Reach the Inbox with Industry-Leading Deliverability
Integrate with Your Application in Minutes
CUSTOMER TESTIMONIAL
Elections Online
"It’s vital to have reliable email notifications accompany each election or I won’t stay in business. I don’t have the expertise needed to get email to the inbox for all the messages I send, nor do I have the time or even the desire to become such an expert.We selected SocketLabs and have never looked back. Using SocketLabs to handle email delivery relieves me of that burden so my focus can remain where it should be: on developing the most innovative voting system available."
- David Simms, President & Founder Elections Online
SocketLabsClient.QuickSend( 000001, //Your SocketLabs ServerId "YOUR-API-KEY", //Your Injection API Key "[email protected]", //The To address for your message "[email protected]", //The From address for your message "Lorem Ipsum", //The Subject line for your message "<html>Lorem Ipsum</html>", //The HTML content for your message "Lorem Ipsum" //The plaintext content for your message );
No credit card required • Sign up in 30 seconds • Get access to all features immediately
Headquarters
700 Turner Ind. Way
Suite 100
Aston, Pa 19014 USA
Company
Features
THOUSANDS of developers trust SocketLabs to deliver billions
of emails every year.
Simply copy & paste the libraries below into your application to start sending!
Get 40K emails/mo to test your API!
Starting at only $39.95/month!
Get 20K emails/mo to test your API!
The SocketLabs Email Delivery Go library allows you to easily send any type of email message supported by our Injection API, from a simple message to a single recipient, to a complex bulk message sent to multiple recipients.
The QuickSend() method is a static method that allows you to quickly and easily send a message to a single recipient with only one statement!
import ( "github.com/socketlabs/socketlabs-go/injectionapi" "github.com/socketlabs/socketlabs-go/injectionapi/message" ) func main() { client := injectionapi.CreateClient(000001, "YOUR-API-KEY") basic := message.BasicMessage{} basic.Subject = "Sending a Basic Message" basic.HtmlBody = "<html>This is the Html Body of my message.</html>" basic.PlainTextBody = "This is the Plain Text Body of my message." basic.From = message.EmailAddress{EmailAddress: "[email protected]"} basic.ReplyTo = message.EmailAddress{EmailAddress: "[email protected]"} //A basic message supports up to 50 recipients and supports several different ways to add recipients basic.AddToEmailAddress("[email protected]") //Add a To address by passing the email address basic.AddCcEmailAddress("[email protected]") //Add a CC address by passing the email address and a friendly name basic.AddBccEmailAddress("[email protected]") //Add a BCC address by passing the email address //Send the message _, _ = client.SendBasic(&basic) }
A basic message is an email message like you'd send from a personal email client such as Outlook. A basic message can have many recipients, including multiple, To Addresses, CC Addresses, and even BCC Addresses. You can also send a file attachment in a basic message.
import ( "github.com/socketlabs/socketlabs-go/injectionapi" "github.com/socketlabs/socketlabs-go/injectionapi/message" ) func main() { client := injectionapi.CreateClient(000001, "YOUR-API-KEY") //Build the message bulk := message.BulkMessage{} bulk.Subject = "Sending A Bulk Message" bulk.HtmlBody = "<html>This is the Html Body of my message sent to the recipient with %%EyeColor%% eyes.</html>"; bulk.PlainTextBody = "This is the Plain Text Body of my message sent to the recipient with %%EyeColor%% eyes."; bulk.From = message.EmailAddress{EmailAddress: "[email protected]"} bulk.ReplyTo = message.EmailAddress{EmailAddress: "[email protected]"} //Add Bulk Recipients recipient1 := bulk.AddToFriendlyBulkRecipient("[email protected]", "Recipient #1") recipient1.AddMergeData("EyeColor", "Green") recipient2 := bulk.AddToFriendlyBulkRecipient("[email protected]", "Recipient #2") recipient2.AddMergeData("EyeColor", "Blue") //Send the message _, _ = client.SendBulk(&bulk) }
A bulk message usually contains a single recipient per message and is generally used to send the same content to many recipients, optionally customizing the message via the use of MergeData.
Scroll down to see our code samples!
To run these samples you will need to obtain an API Key and ServerId number from your SocketLabs Control Panel.