Knowledgebase (2328)
Children categories
Spire.Email supports to manage folder subscriptions by using ImapClient.Subscribe and ImapClient.Unsubscribe method.
The following example shows how to subscribe to a folder and unsubscribe from a folder using Spire.Email component.
Detail steps:
Step 1: Create an ImapClient instance.
ImapClient imap = new ImapClient();
Step 2: Set host, port, authentication and connection protocol.
imap.Host = "outlook.office365.com"; imap.Port = 143; imap.Username = "LeonDavisLD@outlook.com"; imap.Password = "password"; imap.ConnectionProtocols = ConnectionProtocols.Ssl;
Step 3: Connect the imap server.
imap.Connect();
Step 4: Subscribe folder using its name.
imap.Subscribe("Folder1");
Step 5: Unsubscribe folder.
imap.Unsubscribe("Folder2");
Screenshot:

Full code:
using Spire.Email;
using Spire.Email.IMap;
namespace SubscribAndUnsubscribeFolders
{
class Program
{
static void Main(string[] args)
{
//Create an ImapClient instance
ImapClient imap = new ImapClient();
//Set host, port, authentication and connection protocol
imap.Host = "outlook.office365.com";
imap.Port = 143;
imap.Username = "LeonDavisLD@outlook.com";
imap.Password = "password";
imap.ConnectionProtocols = ConnectionProtocols.Ssl;
//Connect the imap server
imap.Connect();
//subscribe folder using its name
imap.Subscribe("Folder1");
//Unsubscribe folder
imap.Unsubscribe("Folder2");
}
}
}
Imports Spire.Email
Imports Spire.Email.IMap
Namespace SubscribAndUnsubscribeFolders
Class Program
Private Shared Sub Main(args As String())
'Create an ImapClient instance
Dim imap As New ImapClient()
'Set host, port, authentication and connection protocol
imap.Host = "outlook.office365.com"
imap.Port = 143
imap.Username = "LeonDavisLD@outlook.com"
imap.Password = "password"
imap.ConnectionProtocols = ConnectionProtocols.Ssl
'Connect the imap server
imap.Connect()
'subscribe folder using its name
imap.Subscribe("Folder1")
'Unsubscribe folder
imap.Unsubscribe("Folder2")
End Sub
End Class
End Namespace
Spire.Presentation supports to insert HTML formatted text to PowerPoint slide. The following code snippets demonstrate how to.
Step 1: Create an instance of Presentation class.
Presentation ppt = new Presentation();
Step 2: Insert an autoshape (rectangle) in slide.
IAutoShape shape = ppt.Slides[0].Shapes.AppendShape(ShapeType.Rectangle, new RectangleF(50, 50, 400, 100));
Step 3: Clear default paragraphs in the shape.
shape.TextFrame.Paragraphs.Clear();
Step 4: Add paragraphs to shape from HTML code. Make sure your HTML segments are written between <html><body> and </body></html> tags, otherwise, AddFromHtml method will fail to work.
string htmlText= "<html><body><p>First paragraph</p><p>Second paragraph</p></body></html>"; shape.TextFrame.Paragraphs.AddFromHtml(htmlText);
Step 5: Save to file.
ppt.SaveToFile("output.pptx", FileFormat.Pptx2013);
Output:

Full Code:
using Spire.Presentation;
using System.Drawing;
namespace AppendHTMLString
{
class Program
{
static void Main(string[] args)
{
Presentation ppt = new Presentation();
IAutoShape shape = ppt.Slides[0].Shapes.AppendShape(ShapeType.Rectangle, new RectangleF(50, 50, 400, 100));
shape.TextFrame.Paragraphs.Clear();
string htmlText = "First paragraph
Second paragraph
";
shape.TextFrame.Paragraphs.AddFromHtml(htmlText);
ppt.SaveToFile("output.pptx", FileFormat.Pptx2013);
}
}
}
Imports Spire.Presentation Imports System.Drawing Namespace AppendHTMLString Class Program Private Shared Sub Main(args As String()) Dim ppt As New Presentation() Dim shape As IAutoShape = ppt.Slides(0).Shapes.AppendShape(ShapeType.Rectangle, New RectangleF(50, 50, 400, 100)) shape.TextFrame.Paragraphs.Clear() Dim htmlText As String = "First paragraph
Second paragraph
" shape.TextFrame.Paragraphs.AddFromHtml(htmlText) ppt.SaveToFile("output.pptx", FileFormat.Pptx2013) End Sub End Class End Namespace
When we operate the email messages, we may need to send the message to many more email address. Spire.Email supports to send a message to many email addresses at one time. This article demonstrates how to add the new send To and Cc email address from an existing email message via Spire.Email in C# and VB.NET.
Firstly, please view the sample email message with one to and cc email address:

How to add new send to and cc email addresses:
using Spire.Email;
namespace Update
{
class Program
{
static void Main(string[] args)
{
//Load the mail message from file
MailMessage mail = MailMessage.Load("Sample.msg");
//add a new To email address and its display name
mail.To.Add(new MailAddress("support@e-iceblue.com", "E-iceblue Support"));
// add a new Cc email address and its display name
mail.Cc.Add(new MailAddress("comments@e-iceblue.com", "Comments"));
// Save the message
mail.Save("ChangeEmailAddress.msg", MailMessageFormat.Msg);
}
}
}
Imports Spire.Email
Namespace Update
Class Program
Private Shared Sub Main(args As String())
'Load the mail message from file
Dim mail As MailMessage = MailMessage.Load("Sample.msg")
'add a new To email address and its display name
mail.[To].Add(New MailAddress("support@e-iceblue.com", "E-iceblue Support"))
' add a new Cc email address and its display name
mail.Cc.Add(New MailAddress("comments@e-iceblue.com", "Comments"))
' Save the message
mail.Save("ChangeEmailAddress.msg", MailMessageFormat.Msg)
End Sub
End Class
End Namespace
Effective screenshot after changing the email address:
