Can we keep froamt natif mail inbbound
You're asking if you can keep the original format of an inbound email from Native Mail (NativeScript's email plugin) in your application.
By default, Native Mail's compose
method returns a MailComposeOptions
object, which is a JavaScript object that contains the email's subject, body, and other properties. This object is not the original email message in its original format.
If you want to keep the original format of the inbound email, you can use the getRawMessage
method provided by Native Mail. This method returns the raw email message as a string, which includes the original headers, body, and attachments.
Here's an example of how you can use getRawMessage
to keep the original format of an inbound email:
import { Mail } from 'nativescript-email';
// Assume 'email' is an instance of the Mail class
const rawMessage = email.getRawMessage();
console.log(rawMessage);
By logging the rawMessage
string, you can see the original email message in its original format, including headers, body, and attachments.
Keep in mind that the getRawMessage
method returns the raw email message as a string, which may not be easily parseable or usable in your application. If you need to process the email message programmatically, you may need to use a library or framework that can parse and manipulate email messages, such as emailjs
or nodemailer
.