• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 115
  • Last Modified:

Passing parameters from one VB prog to another

I have a CGI script, with which I want to send emails, trouble is, in some cases it may be many emails and the CGI program has to finish running quickly.

If I write a second program to do the e-mails how do I call it from my CGI program? Is it possible to pass it e-mail addresses and text to send. There may be upto 100 e-mails but the text should be the same. Can I pass the info. direct or should I use a file / registry.

If possible could anyone give me some example code with the correct syntax. Thanks very much in advance.  
1 Solution
I dont know CGI, but you would call the program thus

yourprog.exe andy@hotmail.com fred@bil.co.uk

you would retrieve the command parameters using command$ in VB which you could parse or simply use.

i.e command$ = "andy@hotmail.com fred@bil.co.uk"

in my example#

Or can CGI write to a text file, if so you can retrieve from a text file in VB real easily.
andyknottAuthor Commented:
The CGI program is written in VB and can do most things that a normal VB program can. I was thinking about writting the e-mail addresses to windows registry, or to a text file which the email program opened.

I take it it would be easier to get the data from a file rather than pass it direct to the email program?

To start a program from a vb program what line of code is required?
You might consider writing your mail program as an ActiveX .exe in which case you can write a fairly simple class to handle all the e-mail stuff and you can pass huge amounts of data both ways without having to resort to writing files.
The simplest way to start a program from a VB program is to use the shell command--Shell(pathname,[windowstyle])

For example to start notepad with the file autoexec.bat loaded you would do: Shell("Notepad autoexec.bat",1)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now