I am using c# in Visual Studio. I have tried console apps and winform apps (both .Net 6)
for the longest time The following line kept returning the error of returning a null. It seems only after making subaccount api keys that it would 'run' without causing a null error...
MailjetClient client = new MailjetClient("cc08a--public key---0fb8868",
"5ff01--secret key--------6dc1")
{
// version = ApiVersion.V3_1,
};
The following method is called from my main() using the line
await SendEmailAsync("p------y@yahoo.com", "heelllloooo", "This is the message buddyyyyyyyyy");
The code is straight from github. I only changed the source and destination email address to both be my own email address
public async Task SendEmailAsync(string email, string subject, string htmlMessage)
{
MailjetClient client = new MailjetClient("cc08a--public key---0fb8868",
"5ff01--secret key--------6dc1")
{
// version = ApiVersion.V3_1, ... had to comment out otherwise it creates an error.
};
MailjetRequest request = new MailjetRequest
{
Resource = Send.Resource,
}
.Property(Send.Messages, new JArray {
new JObject {
{"From", new JObject {
{"Email", email},
{"Name", "Mailjet Pilot"}
}},
{"To", new JArray {
new JObject {
{"Email", email},
{"Name", "Hello"}
}
}},
{"Subject", subject},
{"HTMLPart", htmlMessage}
}
});
MailjetResponse response = await client.PostAsync(request);
}
If I step through the code, the response's ErrorInfo sasy "at least FromEmail or sender must be provided". Of course it is provided! So what is going on?? I am using the same email address as the one I used to sign up with Mailjet, for both the From and To email addresses.
I am using c# in Visual Studio. I have tried console apps and winform apps (both .Net 6)
for the longest time The following line kept returning the error of returning a null. It seems only after making subaccount api keys that it would 'run' without causing a null error...
The following method is called from my main() using the line await SendEmailAsync("p------y@yahoo.com", "heelllloooo", "This is the message buddyyyyyyyyy"); The code is straight from github. I only changed the source and destination email address to both be my own email address
If I step through the code, the response's ErrorInfo sasy "at least FromEmail or sender must be provided". Of course it is provided! So what is going on?? I am using the same email address as the one I used to sign up with Mailjet, for both the From and To email addresses.