Create-and-save-message-into-a-file - 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] **

Create and save message into an .eml file
VB code
Dim wodSMTP As wodSmtpCom
Private Sub Form_Load()
    Set wodSMTP = New wodSmtpCom
    
    ' This sample only creates an e-mail message with all the appropriate headers etc.
    ' You can later use the created file to load it into the component and send.

    ' Let's create a simple e-mail
    wodSMTP.CreateSimple "sender@email.com", "recipient@email.com", "This is subject.", "This is what this email is about."
    
    ' Since Message is created, let's save it into a file
    wodSMTP.Message.Save "C:\Message.eml"
        
End Sub
VB.Net code
Dim wodSMTP As WODSMTPCOMLib.wodSmtpCom
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    wodSMTP = New WODSMTPCOMLib.wodSmtpCom

    ' This sample only creates an e-mail message with all the appropriate headers etc.
    ' You can later use the created file to load it into the component and send.
    
    ' Let's create a simple e-mail
    wodSMTP.CreateSimple("sender@email.com", "recipient@email.com", "This is subject.", "This is what this email is about.");
    
    ' Since Message is created, let's save it into a file
    wodSMTP.Message.Save("C:\Message.eml");

End Sub
C# code
private WODSMTPCOMLib.wodSmtpCom wodSMTP;
private void Form1_Load(object sender, EventArgs e)
{
    wodSMTP = new WODSMTPCOMLib.wodSmtpCom();

    // This sample only creates an e-mail message with all the appropriate headers etc.
    // You can later use the created file to load it into the component and send.

    // Let's create a simple e-mail
    wodSMTP.CreateSimple("sender@email.com", "recipient@email.com", "This is subject.", "This is what this email is about.");
    
    // Since Message is created, let's save it into a file
    wodSMTP.Message.Save("C:\\Message.eml");
}