Archive: Send Outlook Mail from NSIS installer.


Send Outlook Mail from NSIS installer.
Hello

I have problem with win7 x64.
With winXP (32bit) all works fine.

I wrote NSIS installer script to my own program. I wanted this installer to send email and I solve this whit small .vbs code


Send_mail.vbs
--
Set objArgs = Wscript.Arguments

Set MyApp = CreateObject("Outlook.Application","localhost")
Set MyItem = MyApp.CreateItem(0)

With MyItem
.To = "test.test@test.com"
.Subject = objArgs(1) + " Send this mail to xxx xxx"
.ReadReceiptRequested = False
.HTMLBody = "Please SEND THIS MAIL TO XXX!!!<BR><BR>Here is My Attachments<BR><BR>Regards: " + objArgs(1)
.Attachments.Add ( objArgs(0) + "\att_1.bin" )
.Attachments.Add ( objArgs(0) + "\att_2.bin" )
End With
MyItem.Display

--

And in install.nsi file I made call:
Exec '"wscript" "send_mail.vbs" "C:\Program Files (x86)\MyProgram_xxx" "Some_user"'

It’s work’s fine in WinXP but in Win7 x64 I got error:
Windows Scrip Host.
Error: ActiveX component can't create object: 'Outlook.Application'
Code: 800A01AD
Source: Microsoft VBScript runtime error

Any help how I get this WinXP and Win7 (x64)?


There is problem in VB script, not in NSIS.
Try to ask in some VB forum, or maybe someone knows programming in VB here.