การยืนยันอีเมล SENDGRID

ฉันกำลังพยายามใช้การยืนยันอีเมลกับ SendGrid ข้อผิดพลาดที่ฉันได้รับขณะพยายามลงทะเบียนโดยใช้ http://goo.gl/77WXpT บทช่วยสอนนี้คือ:

คำขอไม่ถูกต้อง

คำอธิบาย: มีข้อยกเว้นที่ไม่สามารถจัดการได้เกิดขึ้นระหว่างการดำเนินการคำขอเว็บปัจจุบัน โปรดตรวจสอบการติดตามสแต็กเพื่อดูข้อมูลเพิ่มเติมเกี่ยวกับข้อผิดพลาดและที่มาของโค้ด

รายละเอียดข้อยกเว้น: System.Exception: คำขอไม่ถูกต้อง

ข้อผิดพลาดแหล่งที่มา:

      if (transportWeb != null)
      {
           await transportWeb.DeliverAsync(myMessage);
        }
        else

และซอร์สโค้ดของ IdentityConfig.cs คือ:

 public class EmailService : IIdentityMessageService
{
    public async Task SendAsync(IdentityMessage message)
    {
        await configSendGridasync(message);
    }
    // Use NuGet to install SendGrid (Basic C# client lib) 
    private async Task configSendGridasync(IdentityMessage message)
    {
        var myMessage = new SendGridMessage();
        myMessage.AddTo(message.Destination);
        myMessage.From = new System.Net.Mail.MailAddress(
                            "[email protected]", "Joe S.");
        myMessage.Subject = message.Subject;
        myMessage.Text = message.Body;
        myMessage.Html = message.Body;

        var credentials = new NetworkCredential(
                   ConfigurationManager.AppSettings["mailAccount"],
                   ConfigurationManager.AppSettings["mailPassword"]
                   );

        // Create a Web transport for sending email.
        var transportWeb = new Web(credentials);

        // Send the email.
        if (transportWeb != null)
        {
            await transportWeb.DeliverAsync(myMessage);
        }
        else
        {
            Trace.TraceError("Failed to create Web transport.");
            await Task.FromResult(0);
        }
    }
}

person SKID    schedule 24.10.2014    source แหล่งที่มา
comment
เป็นไปได้มากว่าชื่อผู้ใช้/รหัสผ่านสำหรับ Sendgrid ไม่ถูกต้อง หรือข้อมูลเข้าสู่ระบบที่คุณใช้ไม่มีสิทธิ์ในการส่งอีเมล   -  person trailmax    schedule 25.10.2014
comment
เปลี่ยน [email protected] นี้เป็นของคุณ   -  person Bashar Abu Shamaa    schedule 02.02.2016


คำตอบ (1)


อาจมีปัญหากับข้อมูลรับรองของคุณ

หากคุณลงทะเบียนกับ SendGrid ผ่าน Windows Azure คุณต้องดำเนินการดังต่อไปนี้:

  1. เข้าสู่ระบบ Azure Portal ของคุณ
  2. นำทางไปยัง Marketplace
  3. ค้นหาและคลิกที่แอปพลิเคชัน SendGrid
  4. ด้านล่างสุด คลิกที่ Connection Info
  5. ใช้รายการ Username และ Password

ในตอนแรกฉันรู้สึกรู้สึกว่าต้องใช้รหัสผ่านบัญชี Azure ของฉันจนกระทั่งพบสิ่งนี้ หวังว่านี่จะช่วยแก้ไขปัญหาของคุณเหมือนที่ทำกับฉัน

person FrankO    schedule 04.12.2014