I'm trying mailup for the first time and I just installed the nuget package (1.1.7) from https://www.nuget.org/packages/MailUp.Sdk/
And then to give it a try I've tried the first example in their documentation in here
public static void GetUserInfo(string username, string password)
{
// 1) Setup the MailUp Client:
MailUpClient client = new MailUpClient();
// 2) Invoke the web method:
List<UserInfoDTO> result = null;
try
{
result = client.ListUserInfo(username, password);
}
catch (Exception ex)
{
Console.WriteLine("Cannot perform the operation due to " + ex.Message);
return;
}
// 4) Print results:
if (result != null)
Console.WriteLine("Retrieved users total:" + result.Count);
else
Console.WriteLine("An error occurred while retrieving users.");
}
When I run the code simply it throws null reference exception on the MailUpClient client = new MailUpClient();
line.
Any ideas?
Please find the exception details below:
System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=MailUp.Sdk StackTrace: at MailUp.Sdk.Base.MailUpClient..ctor() at mailupTest.Program.GetUserInfo(String username, String password) in C:\Users...source\repos\mailupTest\mailupTest\Program.cs:line 20 at mailupTest.Program.Main(String[] args) in C:\Users...\source\repos\mailupTest\mailupTest\Program.cs:line 14
User contributions licensed under CC BY-SA 3.0