View Single Post
  #1 (permalink)  
Old January 22nd, 2011, 10:11 AM
Hackoo Hackoo is offline
Registered User
 
Join Date: Jan 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question How to convert this vbscript in HTA ?

Hi
I want to make a small dialog box asking for a few options, and then I want to take those options and send them via e-mail with attachment.
I already have a VBS script that sends e-mail, and I need to use HTA for my form.
How can I combine the VBS script into my HTA, or how can I pass the HTA values to my VBS script?
Here is my mail VBScript:
Code:
sub main()
Dim messageHTML
Set objMessage = CreateObject("CDO.Message") 
objMessage.Subject = [stuff from the HTA] 
objMessage.From = [stuff from the HTA]
objMessage.To = [stuff from the HTA] 
objMessage.TextBody = [stuff from the HTA]
File= [stuff from the HTA] 'path of attachement
messageHTML="This an example in HTML sended by hackoo"
 
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = [stuff from the HTA]
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objMessage.Configuration.Fields.Update

objMessage.HTMLBody="<center><font size=4 FACE=Tahoma Color=red>"&messageHTML&"<br><br><img src=http://photomaniak.com/upload/out.php/i1102064_IDNlogo.gif>"
objMessage.AddAttachment(File) ' adding Attachment
objMessage.Send
 
    If Err.Number <>0 Then
            MsgBox Err.Description,16,"Error"
            msgbox "The mail isn't sended !",16,"Information"
        Else
        msgbox "The mail is sended sucessfully !",64,"Information"
    End If
        On Error GoTo 0 
 end sub
Call main
Thank you !
Best Regards !
Reply With Quote