Outlook MSG फ़ाइलों के लिए फ़ॉलो अप और देय तिथि के साथ काम करना
एक फ़ॉलो‑अप फ़्लैग ईमेल संदेश को किसी कार्रवाई के लिए चिह्नित करता है। Microsoft Outlook उपयोगकर्ताओं को संदेश फ़्लैग करने की अनुमति देता है और फ़्लैग सेट‑अप में फ़ॉलो‑अप के लिए नियत तिथि निर्धारित करता है। Microsoft Outlook प्राप्तकर्ता को रिमाइंडर भेजता है ताकि वे ईमेल को फ़ॉलो‑अप करें। फ़्लैगिंग ईमेल्स और प्रोग्रामेटिक रूप से नियत तिथियों को सेट करना सॉफ़्टवेयर डेवलपर्स को कुछ प्रकार के ईमेल्स को स्वचालित करने और प्राप्तकर्ताओं को कार्रवाई याद रखने में मदद करता है। उदाहरण के लिए, इसे बिक्री टीम को मासिक संदेश भेजने के लिए उपयोग किया जा सकता है जिससे उन्हें अपनी रिपोर्ट पूरी करने की याद दिलाई जा सके; या सभी कर्मचारियों को कंपनी मीटिंग की याद दिलाने के लिए संदेश भेजा जा सकता है। Aspose.Email for .NET फ़ॉलो‑अप फ़्लैग और नियत तिथि को MapiMessage ऑब्जेक्ट्स के लिए FollowUpManager और FollowUpOptions का उपयोग करके सेट करने का समर्थन करता है। कई वैरिएंट हैं जिनमें फ़ॉलो‑अप फ़्लैग को संदेश पर सेट किया जा सकता है। नीचे दिए गए कोड उदाहरण में सभी का उपयोग किया गया है:
- संदेश के लिए फ़ॉलो‑अप फ़्लैग सेट करें
- संदेश में नियत तिथि और स्मरण तिथि जोड़ें
- प्राप्तकर्ता के संदेश में फ़्लैग जोड़ें।
- पूरा के रूप में चिह्नित करें।
- फ़्लैग हटाएँ।
- फ़ॉलो‑अप विकल्प पढ़ें।
फ़ॉलो‑अप फ्लैग सेट करना
निम्नलिखित कोड स्निपेट दिखाता है कि फ़ॉलो‑अप फ़्लैग कैसे सेट करें।
import aspose.email as ae
from datetime import datetime, timedelta
# Create a new MailMessage
mail_msg = ae.MailMessage()
mail_msg.from_address = ae.MailAddress("from@domain.com")
mail_msg.to.append(ae.MailAddress("to@domain.com"))
mail_msg.body = "This message will test if follow-up options can be added to a new MAPI message."
# Convert MailMessage to MapiMessage
mapi = ae.mapi.MapiMessage.from_mail_message(mail_msg)
# Define follow-up options
dt_start_date = datetime(2013, 5, 23, 14, 40, 0)
dt_reminder_date = datetime(2013, 5, 23, 16, 40, 0)
dt_due_date = dt_reminder_date + timedelta(days=1)
options = ae.mapi.FollowUpOptions("Follow Up", dt_start_date, dt_due_date, dt_reminder_date)
# Set follow-up options for the MapiMessage
ae.mapi.FollowUpManager.set_options(mapi, options)
# Save the MapiMessage
mapi.save("SetFollowUpFlag_out.msg")
प्राप्तकर्ताओं के लिए फ़ॉलो‑अप सेट करना
निम्नलिखित कोड स्निपेट दिखाता है कि प्राप्तकर्ताओं के लिए फ़ॉलो‑अप कैसे सेट करें।
import aspose.email as ae
from datetime import datetime
# Create a new MailMessage
mail_msg = ae.MailMessage()
mail_msg.from_address = ae.MailAddress("from@domain.com")
mail_msg.to.append(ae.MailAddress("to@domain.com"))
mail_msg.body = "This message will test if follow-up options can be added to a new MAPI message."
# Convert MailMessage to MapiMessage
mapi = ae.mapi.MapiMessage.from_mail_message(mail_msg)
# Mark the message as draft
mapi.set_message_flags(ae.mapi.MapiMessageFlags.UNSENT)
dt_reminder_date = datetime(2013, 5, 23, 16, 40, 0)
# Add the follow-up flag for recipients
ae.mapi.FollowUpManager.set_flag_for_recipients(mapi, "Follow up", dt_reminder_date)
# Save the MapiMessage
mapi.save("SetFollowUpForRecipients_out.msg")
फ़ॉलो‑अप फ्लैग को पूर्ण चिह्नित करना
निम्नलिखित कोड स्निपेट दिखाता है कि फ़ॉलो‑अप फ़्लैग को पूर्ण के रूप में कैसे चिह्नित करें।
import aspose.email as ae
# Load the MapiMessage from file
mapi_message = ae.mapi.MapiMessage.load("Message.msg")
# Mark the message as completed
ae.mapi.FollowUpManager.mark_as_completed(mapi_message)
# Save the updated MapiMessage
mapi_message.save("MarkedCompleted_out.msg")
फ़ॉलो‑अप फ्लैग हटाना
निम्नलिखित कोड स्निपेट दिखाता है कि फ़ॉलो‑अप फ़्लैग कैसे हटाएँ।
import aspose.email as ae
# Load the MapiMessage from file
mapi_message = ae.mapi.MapiMessage.load("message.msg")
# Clear the follow-up flag
ae.mapi.FollowUpManager.clear_flag(mapi_message)
# Save the updated MapiMessage
mapi_message.save("RemoveFollowUpflag_out.msg")
संदेश के फ़ॉलो‑अप फ्लैग विकल्प पढ़ें
निम्नलिखित कोड स्निपेट दिखाता है कि संदेश के फ़ॉलो‑अप फ़्लैग विकल्प कैसे पढ़ें।
import aspose.email as ae
# Load the MapiMessage from file
mapi_message = ae.mapi.MapiMessage.load("message.msg")
# Get the follow-up options
options = ae.mapi.FollowUpManager.get_options(mapi_message)