Hi,
I am trying to send Email using Backendless server but it give an error while sending Email.
login.page.html :
<ion-title>login</ion-title>
<ion-button (click)= Send()>Backendless
login.page.ts :
constructor(public httpreq: HttpClient ) { }
Send(){
var url = “https://api.backendless.com/<application_id>-<app_key>/messaging/email”;
var body = {
from : “example@gmail.com”,
subject : “Sample Email”,
bodyparts : {
textmessage : “Send Email”,
htmlmessage : “Send Email to me from the backendless server.”
},
to : [ “mymail@gmail.com” ]
}
this.httpreq.post(url, body,
{
headers: { 'Content-Type' : 'application/json' },
}).subscribe(success => {
console.dir("SUCCESS -> " + JSON.stringify(success));
}, error => {
console.dir("ERROR -> " + JSON.stringify(error));
});
}
Error in Chrome Browser Console :
POST https://api.backendless.com/<app_id>/<app_key>/messaging/email 400 (Bad Request)
ERROR -> {“headers”:{“normalizedNames”:{},“lazyUpdate”:null},“status”:400,“statusText”:“Bad Request”,“url”:“https://api.backendless.com/<app_id>/<app_key>/messaging/email”,“ok”:false,“name”:“HttpErrorResponse”,“message”:“Http failure response for https://api.backendless.com/<app_id>/<app_key>/messaging/email: 400 Bad Request”,“error”:{“code”:5045,“message”:“Cannot send email with the default Email Settings. Change the Email Settings in the console and try again”,“errorData”:{}}}
Please help, i need this urgent.