Web güvenli kullanımlı e-postaları Sendgrid'e web api kullanarak gönderemiyorum. (Platform - .Net/C#, SendgridMail)Web günlüğü kullanarak Sendgrid'te güvenli e-posta gönderilemiyor
http url (http://sendgrid.com/api/mail.send) ile birlikte çalışır ancak https (https://sendgrid.com/api/mail) .send) başarısız olur.
private void SendMail()
{
var message = SendGrid.GenerateInstance();
//set the message recipients
message.AddTo("[email protected]");
//set the sender
message.From = new MailAddress("[email protected]");
//set the message body
message.Html = "<html><p>Hello</p><p>World</p></html>";
//set the message subject
message.Subject = "Hello World HTML Test";
//create an instance of the Web transport mechanism
var transportInstance = SendGridMail.Transport.REST.GetInstance(new NetworkCredential("myusername", "mypassword"),"https://sendgrid.com/api/mail.send");
//send the mail
transportInstance.Deliver(message);
}
Bir ArgumentException alıyorum: Bilinmeyen öğe: html. "400 Geçersiz İstek, düz HTTP isteği HTTPS bağlantı noktasına gönderildi/0.7.65 nginx"
Not
O ile çalışıyor:
ayrıntılı sondaj almak http: // url yani: (http://sendgrid.com/api/mail.send) GetInstance işlevinin yerine yukarıdaki (https://sendgrid.com/api/mail.send). tarayıcısı üzerinden e-posta isteği gönderme
çalışıyor: (https://sendgrid.com/api/mail.send.json?to=to%40somedomain.com1 & den% from = 40somdomain.com1 & subject = Testi% 20SG% 20API & metin = sometext & hTML =% 3CB% 3E% 20Test% 20SG% 20api% 20body & api_user = sendgridusername & api_key = sendgridpassword) bu konuda
bir yardım takdir edilmektedir.
Amazon sesine geçin, yaptık, sendgrid'e kıyasla çok daha profesyonel ve eğer doğru bir şekilde kurulum yapılacağını biliyorsanız, bildirimleri de alabilirsiniz. https://nuget.org/packages/Sendgrid –
C# paketi güncelledik. – bwest