Freelance Project Requests Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net


Datei 1:




If you want to send emails directly from a Microsoft Office application, then you must go back to an email sending client.

As a rule, Outlook is used as a remote object.

This example uses a .NET client that directly sends the emails without using Outlook.



In the example, a form is given, which has the fields FROM, TO as email address input. In addition, you need the address of the email server or the domain, via which you want to send the emails.

In combination with the password, the entered message can then be sent as subject and text.


In the code-behind page, a SMTP send control is integrated as a control under Menu-> Extras-> References.

The control is attached in the appendix to the download.


You only have to add a reference to the file: Office_Email_Send.tlb under the Office application.

Here is Microsoft MSAccess.



Refer to the included .tlb file for reference. This includes the code for a simple .NET 4 Email SendClient.



At run time



In the example, the result is returned with True after successful transmission


Option Compare Database

Option Explicit On


Private Sub btnSend_Click()

    '---------------< btnSend_Click() >----------------

    '< variables >

    Dim TO_Email As String

    Dim FROM_Email As String

    Dim Password As String

    Dim SMTP_Domain As String

    Dim Subject_Title As String

    Dim Text_Body As String

    '</ variables >


    '< init >

    TO_Email = tbxEmail_To

    FROM_Email = tbxEmail_From

    Password = tbxPassword

    SMTP_Domain = tbxDomain

    Subject_Title = tbx_Subject

    Text_Body = Text_Body

    '</ init >



    '----< Send Email >----


    Dim objEmail_Sender As New Office_Email_Send.Email_Sender

    Dim IsSend As Boolean


    '< Send >

    IsSend = objEmail_Sender.Send_Email(TO_Email, "", FROM_Email, Password, SMTP_Domain, Subject_Title, Text_Body)

    '< Send >


    MsgBox "Result Email send is: ", vbInformation, "COM Result" & IsSend

    '----</ Send Email >----



    '---------------</ btnSend_Click() >----------------

End Sub





MSAccess, Access, Excel Word, Office

Email Client EmailClient SMTP MailClient SMTPClient COM Control ActiveX 



Contact for Jobs, Project Requests: