이메일 처리용 Node.js API
Node.js 애플리케이션 내에서 MSG, EML, EMLX 및 MHT를 포함한 이메일 형식을 생성, 조작 또는 변환합니다.
Aspose.Email for Node.js via .NET는 유연하면서도 강력한 이메일 프로그래밍 API로, 기본 형식 구현의 복잡성을 걱정할 필요 없이 일반 이메일 메시지 형식을 생성, 조작 또는 변환하여 개발자의 시간과 노력을 절감합니다.
설치 방법
간단히 실행 npm install @aspose/email 최신 버전을 얻고 다음 코드 스니펫을 시도하십시오.
메시지 파일을 동적으로 변환
Aspose.Email for Node.js via .NET은 이메일 파일을 상호 변환할 API를 찾고 있다면 좋은 선택입니다. 기본 형식 사양의 복잡한 세부 사항을 숨기면서 변환 과정을 위한 사용하기 쉬운 인터페이스를 제공합니다. 필요한 작업은 Aspose.Email 객체 모델에 소스 파일을 로드하고 적절한 매개변수를 사용해 Save 메서드를 호출하는 것뿐입니다. 정말 간단합니다!
MSG를 다양한 형식으로 변환
const ae = require('@aspose/email');
const msg= new ae.MailMessage.load(\"msgtemplate.msg\");
// MSG를 EML, HTML 및 MHTML 형식으로 변환 msg.save(\"emloutput.eml\", SaveOptions.defaultEml); msg.save(\"htmloutput.html\", SaveOptions.defaultHtml); msg.save(\"mhtoutput.mhtml\", SaveOptions.defaultMhtml) 약속 ICS 형식에 대한 광범위한 지원
Aspose.Email for Node.js via .NET을 사용하여 약속을 만들고 이를 ICS 형식으로 저장할 수 있습니다. Node.js Email Library는 또한 ICS 파일에서 약속을 로드하고, 약속 이벤트를 읽거나 쓸 수 있으며, 초안으로 약속을 생성하고 참석자의 상태를 설정할 수 있습니다.
약속 만들기 및 저장
const ae = require('@aspose/email');
const attendees = new ae.MailAddressCollection(); attendees.add(new ae.MailAddress(\"person1@domain.com\")); attendees.add(new ae.MailAddress(\"person2@domain.com\")); attendees.add(new ae.MailAddress(\"person3@domain.com\"));
// 생성 const app = new ae.Calendar.Appointment(\"Room 112\", new Date(2006, 6, 17, 13, 0, 0), new Date(2006, 6, 17, 14, 0, 0), new ae.MailAddress(\"somebody@domain.com\"), attendees);
app.summary = \"릴리스 회의\"; app.description = \"다음 릴리스를 논의합니다\";
// ICS로 저장 const options = new ae.Calendar.AppointmentIcsSaveOptions(); // 기본 ICS 옵션 사용 app.save(\"AppointmentInICSFormat_out.ics\", options); 약속 로드
const ae = require('@aspose/email');
const loadedAppointment = ae.Calendar.Appointment.load(\"Appointment.ics\"); // 화면에 약속 정보를 표시 console.log(\"Summary: \", loadedAppointment.summary); console.log(\"Location: \", loadedAppointment.location); console.log(\"Description: \", loadedAppointment.description); console.log(\"Start date::\", loadedAppointment.startDate); console.log(\"End date:\", loadedAppointment.endDate); console.log(\"Organizer: \", loadedAppointment.organizer); console.log(\"Attendees: \", loadedAppointment.attendees); iCalendar API로 회의 생성 및 활용
Aspose.Email for Node.js via .NET는 MSG 및 ICS 형식으로 Outlook 캘린더 항목을 생성 및 저장하는 기능을 제공합니다. iCalendar 객체를 생성하고 저장할 수 있을 뿐만 아니라 회의 요청을 검색, 업데이트, 전송 및 취소할 수도 있습니다. 또한 직관적인 객체 모델을 사용하면 iCalendar RFC 2445 형식의 반복 패턴을 동적으로 생성하고 활용하기 쉽습니다.
약속 요청 생성. 자세히 보기 여기
const ae = require('@aspose/email');
const appWhere = \"location\"; const appWhen = new Date(2023, 8, 17, 13, 0, 0); const sender = new ae.MailAddress(\"from@domain.com\"); const recipient = new ae.MailAddress(\"to@domain.com\"); const attendees = new ae.MailAddressCollection(); attendees.add(recipient);
const app = new ae.Calendar.Appointment(appWhere, appWhen, appWhen, sender, attendees);
const message = new ae.MailMessage(sender, recipient); message.addAlternateView(app.requestApointment()); const msg = ae.Mapi.MapiMessage.fromMailMessage(message);
// Save the appointment. msg.save(\"appointment.msg\"); PST, OST 및 MBOX 파일 생성 또는 조작
Aspose.Email for Node.js via .NET를 사용하면 PST 및 OST와 같은 Outlook 저장 파일을 관리할 수 있습니다. 기존 저장 파일에 대해 다양한 작업을 수행하고 새 PST 파일을 처음부터 만들 수 있습니다. 가능한 작업으로는 폴더 목록, 메시지 목록, 메시지 추출 및 MSG 형식의 연락처가 포함됩니다.
PST 읽기
const ae = require('@aspose/email');
const pst = ae.Storage.Pst.PersonalStorage.fromFile(\"outlook.pst\"); const rootFolders = pst.rootFolder.getSubFolders();
for( folder of rootFolders) { console.log(\"Folder: \", folder.displayName); console.log(\"Total Items: \", folder.contentCount); console.log(\"Total Unread Items: \", folder.contentUnreadCount); console.log(\"----------------------\"); for(msg of folder.enumerateMessages()) { console.log(\" \", msg.subject); } } Outlook 저장 파일과 함께, Aspose.Email for Node.js via .NET는 Mbox 파일 형식도 지원합니다. 기존 Mbox 파일을 로드하고 메시지 정보를 추출하는 데 Aspose.Email for Node.js via .NET를 사용할 수 있습니다.
Extract messages from Mbox
var ae = require('@aspose/email');
const options = new ae.Storage.Mbox.MboxLoadOptions(); // using default options const reader = new ae.Storage.Mbox.MboxrdStorageReader(\"Inbox.mbox\", options); let index = 0; // Read all messages in a loop for(eml of reader.enumerateMessages() ) { console.log(\"Subject: \", eml.subject);
// save message in EML & MSG format
eml.save(`${index}_output.eml`, ae.SaveOptions.defaultEml);
eml.save(`${index}_output.msg`, ae.SaveOptions.defaultMsgUnicode);
++index;
}