Send-HTML-email-from-.html-file-using-Smarthost - 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] **

Send HTML e-mail from .html file using Smarthost
VB code
Dim wodSMTP As wodSmtpCom
Private Sub Form_Load()
    Set wodSMTP = New wodSmtpCom

    ' Set connection parameters
    wodSMTP.HostName = "your_smtp_server_address"
    wodSMTP.Login = "your_login"
    wodSMTP.Password = "your_password"
    
    ' Use Username/Password Authentication
    wodSMTP.Authentication = AuthLogin
    
    ' Use synchronous connection
    wodSMTP.Blocking = True
    
    ' Connect to your SMTP server
    wodSMTP.Connect

    ' Create and send message
    wodSMTP.SendFromHtml "sender@email.com", "recipient@email.com", "This is subject.", "C:\YourHTMLFile.html"

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

    ' Set connection parameters
    wodSMTP.Hostname = "your_smtp_server_address"
    wodSMTP.Login = "your_login"
    wodSMTP.Password = "your_password"

    ' Use Username/Password Authentication
    wodSMTP.Authentication = WODSMTPCOMLib.SmtpAuthentications.AuthLogin

    ' Use synchronous connection
    wodSMTP.Blocking = True

    ' Connect to your SMTP server
    wodSMTP.Connect()

    ' Create and send message
    wodSMTP.SendFromHtml("sender@email.com", "recipient@email.com", "This is subject.", "C:\YourHTMLFile.html")

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

    // Set connection parameters
    wodSMTP.Hostname = "your_smtp_server_address";
    wodSMTP.Login = "your_login";
    wodSMTP.Password = "your_password";

    // Use Username/Password Authentication
    wodSMTP.Authentication = WODSMTPCOMLib.SmtpAuthentications.AuthLogin;

    // Use synchronous connection
    wodSMTP.Blocking = true;

    // Connect to your SMTP server
    wodSMTP.Connect();

    // Create and send message
    wodSMTP.SendFromHtml("sender@email.com", "recipient@email.com", "This is subject.", "C:\\YourHTMLFile.html");
}