Requires a running mail server. If mailConfig is not set the api defaults to a local mail server.
For more information please take a look here.
letnet=$.net;// Create a mail Objectletmail=newnet.Mail({sender:{address:"sender@sap.com"},to:[{name:"John Doe",address:"john.doe@sap.com"},{name:"Jane Doe",address:"jane.doe@sap.com"}],cc:[{address:"cc1@sap.com"},{address:"cc2@sap.com"}],bcc:[{name:"Jonnie Doe",address:"jonnie.doe@sap.com"}],subject:"subject",subjectEncoding:"UTF-8",parts:[newnet.Mail.Part({type:net.Mail.Part.TYPE_TEXT,text:"The body of the mail.",contentType:"text/plain",encoding:"UTF-8",})]});// Set mail server configuration.letmailConfig={"mail.user":"<your-user>","mail.password":"<your-password>","mail.transport.protocol":"smtps","mail.smtps.host":"<your-mail-provider-host>","mail.smtps.port":"465","mail.smtps.auth":"true"};letsmtp=newnet.SMTPConnection(mailConfig);// Send the mail Object with SMPTsmtp.send(mail);// Send the mail Object from the built-in mail send method.letreturnValue=mail.send(mailConfig);$.response.setBody(JSON.stringify(returnValue));