Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Send mail with attached file (Macro VB)

HI,

I want to send mail from a boutton in QV with attached file. I create a macro but I have an error msg " Un composant ActiveX ne peut pas créer un objet: 'CDO.Message'".!! I use outlook to send mail.

this is the macro:

sub Send()

Set objMessage = CreateObject("CDO.Message")

set objConf = CreateObject("CDO.Configuration")

objMessage.Subject = "Tester l'envoi    "

objMessage.From = "admin@adress.com"

objMessage.To = "myadress@me.com"

objMessage.TextBody = "This is a test message text."

'==This section provides the configuration information for the remote SMTP server.

'==Normally you will only change the server name or IP.

objMessage.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server

objMessage.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.me.com"

'Server port (typically 25)

objMessage.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==

objMessage.Send

end sub

1 Reply
vikasmahajan

pfa

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.