MailJet 给出成功响应但未发送

MailJet Giving Success Response But Not Sending

提问人:Vandel212 提问时间:8/23/2023 最后编辑:Vandel212 更新时间:8/23/2023 访问量:93

问:

我只是使用 MailJet 的简单发送电子邮件代码示例。当我使用经过验证的电子邮件地址发送测试电子邮件时,我收到带有邮件 ID 的成功响应,但未发送任何内容。当我查看 MailJet 的网站时,它说 0 已发送和 0 已交付。知道我做错了什么吗?

    private async void button1_Click(object sender, EventArgs e)
    {

        await RunAsync();
    }

    static async Task RunAsync()
    {
        MailjetClient client = new MailjetClient("************", "*************");
        MailjetRequest request = new MailjetRequest
        {
            Resource = Send.Resource,
        }
           .Property(Send.FromEmail, "[email protected]")
           .Property(Send.FromName, "Test Email")
           .Property(Send.Subject, "Test Email Subject")
           .Property(Send.TextPart, "This is a test email!")
           .Property(Send.HtmlPart, "This is a text email!")
           .Property(Send.Recipients, new JArray
                {
                    new JObject
                        {
                            {"Email", "[email protected]"}
                        }
               });
        MailjetResponse response = await client.PostAsync(request);
        if (response.IsSuccessStatusCode)
        {
            Console.WriteLine(string.Format("Total: {0}, Count: {1}\n", response.GetTotal(), response.GetCount()));
            Console.WriteLine(response.GetData());
        }
        else
        {
            Console.WriteLine(string.Format("StatusCode: {0}\n", response.StatusCode));
            Console.WriteLine(string.Format("ErrorInfo: {0}\n", response.GetErrorInfo()));
            Console.WriteLine(string.Format("ErrorMessage: {0}\n", response.GetErrorMessage()));
        }
    }
C# 电子邮件 Mailjet

评论


答: 暂无答案