Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


formed-based email

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1042
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> formed-based email
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 formed-based email - 6/7/2004 7:16:25 AM   
  alemde2013

 

Posts: 1
Score: 0
Joined: 6/7/2004
From: USA
Status: offline
the idea is to have a quick way for someone to email me without having to log into webmail and all that, but I keep getting a type-mismatch error on line 13 of my html document, regardless of how I rearrange stuff on the page. I run windows 2000, so as I understand it CDO is the way to go. the error is somewhere in the script, but I don't know where. here she is:


Option Explicit

sub client_onSubmit

dim objmessage, i, WhoTo(3), Subject, addies(3), ToLine, TotalTrue, TrueSoFar, dbfile, fso
set fso = CreateObject("Scripting.FilesystemObject")
set dbfile = fso.CreateTextFile("c:\documents and settings\administrator\desktop\test.txt", true) 'debugging file...
set objmessage = CreateObject("CDO.message")
set WhoTo = 0
set TotalTrue = 0
set ToLine=""


'yeah i know, lots of addresses.
addies(0) = "-----@hotmail.com"
addies(1) = "-----@fcps1.org"
addies(2) = "-----@heartsfc.com"
addies(3) = "-----@pcs.cnu.edu"

'there is a checkbox for each address...WhoTo is an array that stores
'1 for the selected emails
for i = 0 to 3
if document.client.addresses(i).checked = true then
WhoTo(i) = 1
TotalTrue = TotalTrue + 1
'Totaltrue is here to place commas only in between addresses,
'not after a final address.
end if
Next

for i = 0 to 3
if WhoTo(i) = 1 then
TrueSoFar = TrueSoFar + 1
ToLine = ToLine & addies(i)
if TrueSoFar < TotalTrue then
ToLine = ToLine & "; "
end if
end if
Next

'more debugging trash
dbfile = WriteLine(document.client.subject.value)
dbfile = WriteLine(ToLine)
dbfile = WriteLine(document.client.msg.value)


objmessage.Subject = document.client.subject.value
objmessage.Sender = "Ally's E!mail"
objmessage.To = ToLine
'text area "msg" on the HTML page that contains the text
objmessage.TextBody = document.client.msg.value
objmessage.TextBody = objmessage.TextBody & chr(13) & chr(13)
objmessage.TextBody = "******************************" & chr(13)
objmessage.TextBody = "Craig and Ally's E!Mail, V1.0"

'throwing stuff at the wall to see if it sticks
objobjmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
objobjmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.fcps1.org"

'Server port (typically 25)
objobjmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objobjmessage.Configuration.Fields.Update

objmessage.Send

end sub
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> formed-based email Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts