want to send emails directly from a Microsoft Office application, then you must
go back to an email sending client.
rule, Outlook is used as a remote object.
example uses a .NET client that directly sends the emails without using
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.
combination with the password, the entered message can then be sent as subject
code-behind page, a SMTP send control is integrated as a control under
Menu-> Extras-> References.
control is attached in the appendix to the download.
only have to add a reference to the file: Office_Email_Send.tlb under the
Here is Microsoft MSAccess.
to the included .tlb file for reference. This includes the code for a simple
.NET 4 Email SendClient.
At run time
example, the result is returned with True after successful transmission
Option Compare Database
Option Explicit On
'< variables >
Dim TO_Email As String
FROM_Email As String
Dim Password As String
SMTP_Domain As String
Subject_Title 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 >----
objEmail_Sender As New
Dim IsSend As Boolean
'< Send >
IsSend = objEmail_Sender.Send_Email(TO_Email, "",
FROM_Email, Password, SMTP_Domain, Subject_Title, Text_Body)
'< Send >
Email send is: ", vbInformation, "COM
Result" & IsSend
'----</ Send Email >----
Access, Excel Word, Office
Client EmailClient SMTP MailClient SMTPClient COM Control ActiveX