I am using vfp6 SP5 I am calling a com component through foxisapi,
everything works fine. The last part of the project is to create an email
when a page is submitted. I wanted to use a tool that could communicate
directly with an SMTP server. I used the following code with blat.dll (only
the relevant code is shown).
LOCAL lcDll, lcCmd, lnResult

lcDll = locFile("..\common\bin\blat.dll")

cBodyFile = tempFile("txt", .t.)

strToFile("Please do not resply to this message as it was generated by an
automated process", cBodyFile)

DECLARE INTEGER Send IN (lcDll) STRING blatstring

lcCmd = cBodyFile + ' -t ' + alltrim(Email) + ' -s "EDI" -f
stuff@address.com.au ' + '-server ' + alltrim(SMTPserver) + ' -attach ' +
oEDI.cFileName

lnResult = Send(lcCmd)

I also tried using a different approach with wwipstuff. Both have the same
problem, if I step through the code in a standard foxpro environment an
email is generated. If I run it through the web server, no email is
generated and the process completes but becomes unstable and eventually
locks up. To communicate directly with the mail server these processes must
be using sockets, so that must be causing the problem for them both to be
failing, but I don't understand how that could be. I downloaded the latest
version of Foxisapi from the MS site but it didn't help.
It's a tough one but I was hoping someone might have some insight into
what's going on.
Thanks.

Re: Foxisapi and Blat.dll (or wwipstuff.sendMail) by Claude

Claude
Fri Jul 01 12:50:07 CDT 2005

Make sure your anonymous web user accounts have access to where you're
reading and writing files to/from. Those are the iusr_<yourcomputername>
and iwam_<yourcomputername>. Also, you may want to try CDO or CDONTS as
well since these are already built into the OS. I use them from VFP mtdlls
called from ASP.NET or ASP all of the time. See:
http://www.dotcomsolution.com/avfpdemo3/default.aspx?action=email1

http://www.activevfp.com
"Paul" <pauln.o.s.p.a.m@laberg.com.au> wrote in message
news:%23qf1G1kfFHA.2644@TK2MSFTNGP09.phx.gbl...
>I am using vfp6 SP5 I am calling a com component through foxisapi,
>everything works fine. The last part of the project is to create an email
>when a page is submitted. I wanted to use a tool that could communicate
>directly with an SMTP server. I used the following code with blat.dll (only
>the relevant code is shown).
> LOCAL lcDll, lcCmd, lnResult
>
> lcDll = locFile("..\common\bin\blat.dll")
>
> cBodyFile = tempFile("txt", .t.)
>
> strToFile("Please do not resply to this message as it was generated by an
> automated process", cBodyFile)
>
> DECLARE INTEGER Send IN (lcDll) STRING blatstring
>
> lcCmd = cBodyFile + ' -t ' + alltrim(Email) + ' -s "EDI" -f
> stuff@address.com.au ' + '-server ' + alltrim(SMTPserver) + ' -attach ' +
> oEDI.cFileName
>
> lnResult = Send(lcCmd)
>
> I also tried using a different approach with wwipstuff. Both have the same
> problem, if I step through the code in a standard foxpro environment an
> email is generated. If I run it through the web server, no email is
> generated and the process completes but becomes unstable and eventually
> locks up. To communicate directly with the mail server these processes
> must be using sockets, so that must be causing the problem for them both
> to be failing, but I don't understand how that could be. I downloaded the
> latest version of Foxisapi from the MS site but it didn't help.
> It's a tough one but I was hoping someone might have some insight into
> what's going on.
> Thanks.
>
>



Re: Foxisapi and Blat.dll (or wwipstuff.sendMail) by Lew

Lew
Fri Jul 01 12:54:41 CDT 2005

You don't have to worry about foxaspi with blat. What value for lnResult is
being returned? Also, try enclosing the subject in quotes, ie -s ["EDI"]
-Lew
"Paul" <pauln.o.s.p.a.m@laberg.com.au> wrote in message
news:%23qf1G1kfFHA.2644@TK2MSFTNGP09.phx.gbl...
>I am using vfp6 SP5 I am calling a com component through foxisapi,
>everything works fine. The last part of the project is to create an email
>when a page is submitted. I wanted to use a tool that could communicate
>directly with an SMTP server. I used the following code with blat.dll (only
>the relevant code is shown).
> LOCAL lcDll, lcCmd, lnResult
>
> lcDll = locFile("..\common\bin\blat.dll")
>
> cBodyFile = tempFile("txt", .t.)
>
> strToFile("Please do not resply to this message as it was generated by an
> automated process", cBodyFile)
>
> DECLARE INTEGER Send IN (lcDll) STRING blatstring
>
> lcCmd = cBodyFile + ' -t ' + alltrim(Email) + ' -s "EDI" -f
> stuff@address.com.au ' + '-server ' + alltrim(SMTPserver) + ' -attach ' +
> oEDI.cFileName
>
> lnResult = Send(lcCmd)
>
> I also tried using a different approach with wwipstuff. Both have the same
> problem, if I step through the code in a standard foxpro environment an
> email is generated. If I run it through the web server, no email is
> generated and the process completes but becomes unstable and eventually
> locks up. To communicate directly with the mail server these processes
> must be using sockets, so that must be causing the problem for them both
> to be failing, but I don't understand how that could be. I downloaded the
> latest version of Foxisapi from the MS site but it didn't help.
> It's a tough one but I was hoping someone might have some insight into
> what's going on.
> Thanks.
>
>



Sockets by Paul

Paul
Sun Jul 03 06:15:59 CDT 2005

The return value is 0. I have the subject in quotes, as I mentioned I have
been able to step through this code and generate an email. It seems to be
almost a winsock issue as I have since found another sockets process that is
unable to connect while running as a process. I have found that sometimes I
do actually get the email that I sent, but the process becomes unstable and
when running on the console I get the message "Unable to read from memory
location ...." so it appears the process is dying a sudden death in the
background.

However, I have verified that winsock is working ok when under a standard
login.

BTW: This is running on a terminal services box.

"Lew" <lew@clsystems.com> wrote in message
news:uIXSwWmfFHA.2700@TK2MSFTNGP15.phx.gbl...
> You don't have to worry about foxaspi with blat. What value for lnResult
> is being returned? Also, try enclosing the subject in quotes, ie -s
> ["EDI"]
> -Lew
> "Paul" <pauln.o.s.p.a.m@laberg.com.au> wrote in message
> news:%23qf1G1kfFHA.2644@TK2MSFTNGP09.phx.gbl...
>>I am using vfp6 SP5 I am calling a com component through foxisapi,
>>everything works fine. The last part of the project is to create an email
>>when a page is submitted. I wanted to use a tool that could communicate
>>directly with an SMTP server. I used the following code with blat.dll
>>(only the relevant code is shown).
>> LOCAL lcDll, lcCmd, lnResult
>>
>> lcDll = locFile("..\common\bin\blat.dll")
>>
>> cBodyFile = tempFile("txt", .t.)
>>
>> strToFile("Please do not resply to this message as it was generated by an
>> automated process", cBodyFile)
>>
>> DECLARE INTEGER Send IN (lcDll) STRING blatstring
>>
>> lcCmd = cBodyFile + ' -t ' + alltrim(Email) + ' -s "EDI" -f
>> stuff@address.com.au ' + '-server ' + alltrim(SMTPserver) + ' -attach ' +
>> oEDI.cFileName
>>
>> lnResult = Send(lcCmd)
>>
>> I also tried using a different approach with wwipstuff. Both have the
>> same problem, if I step through the code in a standard foxpro environment
>> an email is generated. If I run it through the web server, no email is
>> generated and the process completes but becomes unstable and eventually
>> locks up. To communicate directly with the mail server these processes
>> must be using sockets, so that must be causing the problem for them both
>> to be failing, but I don't understand how that could be. I downloaded the
>> latest version of Foxisapi from the MS site but it didn't help.
>> It's a tough one but I was hoping someone might have some insight into
>> what's going on.
>> Thanks.
>>
>>
>
>