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:
Thank you !
Best Regards !
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 _
("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2
objMessage.Configuration.Fields.Item _
("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = [stuff from the HTA]
objMessage.Configuration.Fields.Item _
("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = 25
objMessage.Configuration.Fields.Update
objMessage.HTMLBody="<center><font size=4 FACE=Tahoma Color=red>"&messageHTML&"<br><br><img src=[URL unfurl="true"]http://photomaniak.com/upload/out.php/i1102064_IDNlogo.gif>"[/URL]
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
Best Regards !