Load-message-from-eml-file-and-change-sender-and-recipient - WeOnlyDo Software example code



All

wodCrypt (12)
wodSSH (10)
wodSFTP (23)
wodSSHServer (1)
wodSSHTunnel (11)
wodSSHpackage
wodSFTPdll

wodSSH.NET (10)
wodSFTP.NET (24)
wodFtpDLX.NET (22)
wodWebServer.NET (10)

wodAppUpdate (13)
wodHttpDLX (8)
wodFtpDLX (22)
wodTelnetDLX
wodFTPServer (3)
wodWebServer (10)
wodVPN
wodXMPP (13)
All ** [Visual Basic] ** [C#] ** [VB.NET] **

Load message from eml file and change sender and recipient
VB code
Dim wodMailbox1 As wodMailboxCom
Set wodMailbox1 = New wodMailboxCom

'You can load any email message using Filename Property.
wodMailbox1.FileName = "c:\email1.eml"
wodMailbox1.Lock

wodMailbox1.Messages(0).From = ""
wodMailbox1.Messages(0).From = "John Smith  jsmith@domain.com"  'specify new email message sender
wodMailbox1.Messages(0).To = ""
wodMailbox1.Messages(0).To = "new@domain.com" 'specify new recipient of email message 

'Save email message to new file.
wodMailbox1.Messages(0).Save ("c:\message1.eml")
VB.NET code
Dim wodMailbox1 As WODMAILBOXCOMLib.wodMailboxCom
wodMailbox1 = New WODMAILBOXCOMLib.wodMailboxCom

'You can load any email message using Filename Property.
wodMailbox1.Filename = "c:\email1.eml"
wodMailbox1.Lock()

wodMailbox1.Messages(0).From = ""
wodMailbox1.Messages(0).From = "John Smith  jsmith@domain.com" 'specify new email message sender
wodMailbox1.Messages(0).To = ""
wodMailbox1.Messages(0).To = "new@domain.com" 'specify new recipient of email message

'Save email message to new file.
wodMailbox1.Messages(0).Save("c:\message1.eml")
C# code
WODMAILBOXCOMLib.wodMailboxCom wodMailbox1;
wodMailbox1 = new WODMAILBOXCOMLib.wodMailboxCom();

//You can load any email message using Filename Property.
wodMailbox1.Filename = "c:\\email1.eml";
wodMailbox1.Lock();

wodMailbox1.Messages[0].From = "";
wodMailbox1.Messages[0].From = "John Smith  jsmith@domain.com"; //specify new email message sender
wodMailbox1.Messages[0].To = "";
wodMailbox1.Messages[0].To = "new@domain.com"; //specify new recipient of email message

//Save email message to new file.
wodMailbox1.Messages[0].Save("c:\\message1.eml",null);