Page Index Toggle Pages: 1 [2] 3  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) @SendMail() (Read 5135 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: @SendMail()
Reply #15 - Mar 7th, 2004 at 3:57pm
Print Post Print Post  
Thanks. I'll go look it up!

Steve in Texas
  
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @SendMail()
Reply #16 - Mar 7th, 2004 at 4:20pm
Print Post Print Post  
I believe, you are looking for code for the sending site and for receiving side. The receiving side is simple just import the text file. The sending site will have a command button that will export file the data to ascii file, insert that file to one of the elements using @insert function and @sendmail to send the email. I have not done this but it seems like do-able. You might want to ignore the previous programming reference as simple importing file manually will serve the purpose.
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: @SendMail()
Reply #17 - Mar 7th, 2004 at 4:30pm
Print Post Print Post  
I think I'm going to look into "scheduling" an FTP session every night that will transmit any files saved in a certain folder.

I'll have sesame export the needed data in .txt files and save them in the above mentioned folders.

I think this will be easier for me. WS_FTP looks like just the right FTP software to handle scheduled tasks such as this.

Any other thoughts?

Thanks,
Steve in Texas
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: @SendMail()
Reply #18 - Mar 7th, 2004 at 4:42pm
Print Post Print Post  
Can someon help me fix this line. I need the file to have quotes, but the quotes seem to be confusing Sesame. This is a command line to startup WS_FTP, then connect to Anti-Virus FTP SIte and autodownload a file. I'm placing this in "on element entry" of a command button.

@shell =("C:\PROGRAM FILES\WS_FTP\wsftppro.exe" -s "Predefined Sites!Anti-Virus!Symantec:/public/english_us_canada/antivirus_definitions/norton
_antivirus/20040303-009-i32-1.exe" -d "local:C:\Sesame\DL\")

Note the open and closed quoates withing the () which, it appears, is needed by windows XP to find the file WS_Ftp.exe but -s should not be in quotes.

This command line works fine from the Start>Run button, but cant get it to work in Sesame.

Thanks!
Steve
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: @SendMail()
Reply #19 - Mar 7th, 2004 at 4:45pm
Print Post Print Post  
Try replacing the quotes that are "inside" your string with @chr(34) so Sbasic won't think that they terminate the string.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @SendMail()
Reply #20 - Mar 7th, 2004 at 4:47pm
Print Post Print Post  
One can operate Sesame over the Internet and this would not involve any transferring files. The computer at work has to be connected to Internet preferably through broadband so as to accomodate speed and being connected all the time. Advantage to this is that you can monitor it anytime, anywhere and no special export or import involved. Just a thought.
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: @SendMail()
Reply #21 - Mar 7th, 2004 at 4:54pm
Print Post Print Post  
Bharat,

I'm not sure if we are ready for that. Our coporate office uses  Q&A and we are experimenting with Sesame. The Corp office wont upgrade until Sesame has been proven at my location. So until then, we will be importing/exporting files between our systems to keep synchronized. (I have dialup so I think email or ftp may be the most reliable way.

Also, I think the system we are setting up now is good practice so when we do move to sesame connections via broadband, we can fall back on this system in case our connection breaks for a time period. (I have a retail store, and if I lose access to the server, I dont know how I would process a transaction during this outage.)

Thanks for the ideas.

Steve in Texas
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: @SendMail()
Reply #22 - Mar 7th, 2004 at 5:12pm
Print Post Print Post  
The Cow, Your suggestion sounds like it would work, but I'm still having problems. (button doesnt seem to do anything and i havent learned how to use the writeln command to give an error message ......yet.

Heres what I'm trying as per your suggestion:

var Vupdate as string

if @askuser("check for updates?", "", "") then

Vupdate = @shell("@chr(34)C:\PROGRAM FILES\WS_FTP\wsftppro.exe@chr(34) -s
     @CHR(34)Predefined Sites!Anti-Virus!Symantec:/public/english_us_canada/antivirus_definitions/norton
_antivirus/20040303-009-i32-1.exe@CHR(34) -d
     @CHR(34)local:C:\Sesame\DL\@chr(34)")


It looks like a dos box pops up for a second, but its too fast to read what its trying to do.

Thanks for the help!

Steve in Texas
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: @SendMail()
Reply #23 - Mar 7th, 2004 at 5:24pm
Print Post Print Post  
Opposite problem, you now have the @chr(34)s inside your quotes - where they can't run. Try this:

Vupdate = @shell("C:\PROGRAM FILES\WS_FTP\wsftppro.exe" + @chr(34) + "-s" + 
@CHR(34) + "Predefined Sites!Anti-Virus!Symantec:/public/english_us_canada/antivirus_definition s/norton_antivirus/20040303-009-i32-1.exe" + @CHR(34) + " -d" + @CHR(34) + "local:C:\Sesame\DL\")
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: @SendMail()
Reply #24 - Mar 7th, 2004 at 6:07pm
Print Post Print Post  
Mark,

I pasted your line into sesame (and removed some excess spaces) and it still doesnt do anything.)

I'll keep working on it.

Thanks

Steve in Texas
  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: @SendMail()
Reply #25 - Mar 7th, 2004 at 8:23pm
Print Post Print Post  
It looks like you didn't have enough spaces.  Try something more like this:
Code
Select All
Vupdate = @shell(@chr(34) + "C:\PROGRAM FILES\WS_FTP\wsftppro.exe" + @chr(34) + " -s " + @CHR(34) + "Predefined Sites!Anti-Virus!Symantec:/public/english_us_canada/antivirus_definitions/norton_antivirus/20040303-009-i32-1.exe" + @CHR(34) + " -d " + @CHR(34) + "local:C:\Sesame\DL\" + @chr(34)) 


It will produce this output:
"C:\PROGRAM FILES\WS_FTP\wsftppro.exe" -s "Predefined Sites!Anti-Virus!Symantec:/public/english_us_canada/antivirus_definitions/norton
_antivirus/20040303-009-i32-1.exe" -d "local:C:\Sesame\DL\"

I don't know exactly what the syntax should be on the output, but it looks like there needs to be a quote at the start and finish, and also spaces around the -s and -d switches.

This is what Mark's code produces:
C:\PROGRAM FILES\WS_FTP\wsftppro.exe"-s"Predefined Sites!Anti-Virus!Symantec:/public/english_us_canada/antivirus_definition  s/norton_antivirus/20040303-009-i32-1.exe" -d"local:C:\Sesame\DL\
(Sorry Mark Tongue)

PS: For some reason this msg board keeps adding a space within the word definitions, between the n and s, even though there is no space there while I am composing this msg.  So be careful to inspect the code closely when you cut and paste it from here.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: @SendMail()
Reply #26 - Mar 7th, 2004 at 10:28pm
Print Post Print Post  
Carl, thanks for the help. It still didnt work 100%, so I deleted the whole command line except for loading the program itself and it did load, so you technique must be the one that works. I think the problem is the quotes around the -s and -d, etc.

I took a simpler approach and just put the command line in a .bat file and had sesame call the batch file and it worked great.

I appreciate everyones help! I'll learn up on this problem more when i am more experienced with programming.

Steve in Texas
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: @SendMail()
Reply #27 - Mar 7th, 2004 at 10:33pm
Print Post Print Post  
Hey Bob,

Does the Outlook command line programming work for you?

It seems like you should be getting the same error I was getting in trying to load my FTP program:

Since there are more than 8 characters in the path C:\Program files.....", the computer requires you to put quotes around the path, but I see you did not in your examples for auto sending email and calendar appointments.

I couldnt get your examples to work for me,  could you copy and paste your code exactly as it appears in sesaame so I can try it?

Thanks,
Steve in Texas
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: @SendMail()
Reply #28 - Mar 8th, 2004 at 1:48am
Print Post Print Post  
Hi Steve.....the code that I pasted was not directly from Sesame.   I did it from the command line.  Sorry about that.

2.  Here is the correct syntax to handle the long file names.
Quote:
var n as INT
n = @SHELL(@CHR(34) + "C:\Program Files\Microsoft Office\Office\outlook.exe" + @CHR(34) + " /c ipm.note /m recipient1@myplace.com")

and here is the correct syntax to handle the short file names:
Quote:
var n as INT
n = @SHELL("C:\Progra~1\Micros~1\Office\outlook.exe /c ipm.note /m recipient1@myplace.com")


These test out OK for me using ElementExitEvent.

In reviewing your comments I found the following:
1.  There was a space missing between /m and recipient.  I have modified the original posting to reflect that change and to insert the space.

2.  I also found that if I have three or more recipients, then it does not work at all!  Curious since all recipients are in one string.  I think that the semicolon delimiter might be causing a problem with @Shell.

3.  But the multiple recipients can be handled with a batch file.  I created a batch files with the following contents:
Quote:
"C:\Program Files\Microsoft Office\Office\outlook.exe" /c ipm.note /m recipient1@myplace.com;recipient2@yourplace.com;recipient3@anyplace.com
which  executed OK, all three recipients are in there.  Using @Shell("batchfile.bat") works OK.

I will also change the syntax on my original posting to prevent any future confusion.  Thanks for pointing out my error.

  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: @SendMail()
Reply #29 - Mar 8th, 2004 at 1:57am
Print Post Print Post  
Thanks Bob! I'll try it out later this week.

Steve in Texas
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 
Send Topic Send Topic Print Print