Hi all!
This is my first post here, so, have mercy
I use following code to send an email from MS Access:
Everything works great, but I need to have Outlook open to send this email. If I keep the Outlook close, the email not will be send.
How to send an email WITHOUT to need to open MS Outlook? If it's possible, of course.
Thank's in advance.
koci.
This is my first post here, so, have mercy
I use following code to send an email from MS Access:
Code:
Dim MiOutlook As Outlook.Application
Dim MiCorreo As Outlook.MailItem
Dim NombreFichero As String
Dim NombreFicheroConRuta As String
NombreFichero = DLookup("NombreFicheroEnlace", "EMPRESA")
NombreFicheroConRuta = "C:\" & NombreFichero & ".zip"
Set MiOutlook = New Outlook.Application
Set MiCorreo = MiOutlook.CreateItem(olMailItem)
With MiCorreo
'Direccion
.To = "Nicolas_Yahoo"
'Titulo
.Subject = "Test"
'Mensaje
.Body = "Test" & Date
'Fichero attachment
.Attachments.Add NombreFicheroConRuta, olByValue, 1, "FicheroEnlace"
'Envia
.Send
End With
'Elibera recursos
Set MiCorreo = Nothing
Set MiOutlook = Nothing
Everything works great, but I need to have Outlook open to send this email. If I keep the Outlook close, the email not will be send.
How to send an email WITHOUT to need to open MS Outlook? If it's possible, of course.
Thank's in advance.
koci.