-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathBasicSendWithRetry.cs
More file actions
33 lines (27 loc) · 1.04 KB
/
BasicSendWithRetry.cs
File metadata and controls
33 lines (27 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Net;
using SocketLabs.InjectionApi;
using SocketLabs.InjectionApi.Message;
namespace dotNetCoreExample.Examples.Basic
{
public class BasicSendWithRetry : IExample
{
public SendResponse RunExample()
{
var proxy = new WebProxy("http://localhost:4433", false);
var client = new SocketLabsClient(ExampleConfig.ServerId, ExampleConfig.ApiKey, proxy)
{
EndpointUrl = ExampleConfig.TargetApi,
NumberOfRetries = 3
};
var message = new BasicMessage();
message.Subject = "Sending A Test Message With Retry Enabled";
message.HtmlBody = "<html>This is the Html Body of my message.</html>";
message.PlainTextBody = "This is the Plain Text Body of my message.";
message.From.Email = "from@example.com";
message.ReplyTo.Email = "replyto@example.com";
message.To.Add("recipient1@example.com");
return client.Send(message);
}
}
}