Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 22nd, 2011, 10:11 AM
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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Running SAPI.SpVoice with HTA or WSH aspless Javascript 2 June 18th, 2008 06:56 AM
Convert JavaScript OK/CANCEL to VBScript timmerdfw VBScript 0 January 4th, 2007 03:42 PM
Convert a batch file to run in VBscript - WSH issu malcomm VBScript 0 October 25th, 2006 12:35 AM
CALLING a EXE from a HTA (or HTML) stalker Javascript 1 November 1st, 2004 02:18 AM
Convert JPG to GIF using ASP/VBScript bosboom Classic ASP Components 0 July 10th, 2003 02:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.