Update the send to email address for Email message

Update the send to email address for Email message

2017-07-27 08:28:36 Written by  Koohji
Rate this item
(0 votes)

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:

Update the send to email address for Email message

How to add new send to and cc email addresses:

[C#]
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);   
        }
    }
}
[VB.NET]
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:

Update the send to email address for Email message

Additional Info

  • tutorial_title:
Last modified on Wednesday, 15 September 2021 03:31