Step to integrate Pepipost C# .Net library with Visual Studio 2017 using Git (Without any package manager/Nuget)
If you are using Visual Studio for development and want to integrated with Pepipost directly by using Git, then below steps will help you in integrating this Pepipost C# code library in our IDE.
- Microsoft visual Studio 2017
- NETStandard.Library(>= 1.6.1)
- Newtonsoft.Json
- A free account on Pepipost.If you don't have a one, click here to sign-up and get 30,000 emails free every month.
-
Download Pepipost SDK
Unzip the SDK on any Location of your choice (we will unzipped in directory named testSDK)
OR
git clone https://github.com/pepipost/pepipost-sdk-csharp.git
-
For starting a new project, right click on the current solution from the Solution Explorer
Choose Add -> New Project.
-
Next, choose "Console Application", provide a TestConsoleProject as the project name and click OK.
-
Set as startup project
The new console project is the entry point for the eventual execution. This requires us to set the
TestConsoleProject
as the start-up project.To do this, right-click on the TestConsoleProject
Choose Set as StartUp Project from the context menu.
-
Add reference of the library project
In order to use the Pepipost C# library in the new project, first we need to add a projet reference to the TestConsoleProject.
First, right click on the References node in the Solution Explorer
Click Add Reference.
Next, a window will be displayed where we must set the Checkbox on PepipostAPI.Standard
Click OK.
By doing this, we have added a reference of the PepipostAPI.Standard project into the new TestConsoleProject.
-
Once all the packages are installed and TestConsoleProject is created, a file named Program.cs will be visible in the Solution Explorer with an empty Main method.
This is the entry point for the execution of the entire solution.
Here, you can add simpleUsage.md code
-
Update the api_key and FromEmail parameters:
- apikey: This will be available under: Login to your Pepipost account -> Settings -> Integration
- FromEmail: If your fromemail address is e.g. info@mydomain.com, then the Sending Domain mydomain need to be verified and active under your Pepipost account. You can manage the Sending Domain under: Login to Pepipost -> Settings -> Sending Domains
-
Change apiKey and FromEmail in your script:
string apiKey = "XXXXX-your-api-key-XXXX"
(near by line no 25 if your have copy the simpleUsage.md)body_personalizations_0.Recipient = "your recipient emailid here"
(near by line no 31)body.From.FromEmail = "info@ your-verified-domain"
(near by line no 37) -
Build the project to finally send your first test email Run the project.
Run the project by hiting Ctrl + F5
If your apikey and sending domain is proper, then response message will be success.
Hope, you have received your first test email 😃
If there is some problem related with config, then you will receive error message as shown below: