im working with codenameone and i was trying to send an email via codenameone cloud when updating dog table everything works fine but its not sending any mail I got strikethrough on the method sendMessageViaCloudSync() I know that means this methodes is replaced but I cant find any documentation so whats the new methodes and how can I work with it ?
public void updateDog(int id,int note) {
Dialog d=new Dialog();
if(d.show("Noter chien","vous voulez vraiment attribuer cette note?","Oui","Non"))
{
String url=Statics.BASE_URL+"/api/chiens/notechien/"+id+"/"+note;
req.setUrl(url);
NetworkManager.getInstance().addToQueueAndWait(req);
Message m = new Message("<html><body>Check out <a href=\"https://www.codenameone.com/\">Codename One</a></body></html>");
m.setMimeType(Message.MIME_HTML);
boolean success = m.sendMessageViaCloudSync("Codename One", "louay.gourrida@esprit.tn", "Name Of User", "Message Subject",
"Check out Codename One at https://www.codenameone.com/");
/*
Message m = new Message("Hello \nWe want to inform you that your dog just got a new rating open Mobile app and check out");
Display.getInstance().sendMessage(new String[] {"louay.gourrida@esprit.tn"}, "New Rating", m);
*/
d.dispose();
}
}
that the function that updates dog table and send the email
When you hover over a method that's deprecated you should get a hint that includes the suggested alternative.
In this case we removed the method entirely since the concept was problematic. It caused spam issues where outgoing emails were sent to spam folders.
As a replacement we introduced the SendGrid cn1lib which you can use to send emails via sendgrid.