Re: Using Blat with variables by swdev2
swdev2
Wed Jun 27 21:41:38 CDT 2007
Hi Rusty -
Blat also has a dll version - I use it a lot in our commercial apps.
Here's a set o commands that i use IN VFP for the dll, munged a bit
to hide passwords, from a prg file. You can also make a classlib , or
method code in a form.
USE table1 IN 0
USE logfile IN 0
CLEAR DLLS
LOCAL lcDll, lcCmd, lnResult
lcDll = "c:\blat\blat.dll"
DECLARE INTEGER Send IN (lcDll) STRING blatstring
SELECT table1
GO top
SCAN FOR ctype == 'B'
lcCmd = 'd:\efg\blurb\severson.txt -attach
D:\efg\blurb\ns2\bl1.jpg,D:\efg\blurb\ns2\BL2.jpg -t ' + ALLTRIM(email) +
' -s "EROTAX Registration Info" -log c:\blat\testme.txt -u
someuser@efgroup.biz -pw blackey -f someuser@efgroup.biz'
&&lcCmd is all one line, you can rebuild it with line continuation
characters.
lnpkkey = pkkey &&something for the logfile
INSERT INTO logfile (fkkey, dtstamp, crunno) VALUES (lnpkkey,DATETIME(),6)
? ALLTRIM(email)
lnResult = Send(lcCmd) &&call to the Blat Send Method
SELECT table1
endscan
But basically, anything that is inside of the 'blat' lcCmd string that is a
DASH OPTION - ie '-t' -
you can set the appropriate TEXT values using built in VFP language,
using field names or memory variables.
If you need to see all of the DASH OPTIONS - invoke blat from the DOS
command box, issue - blat --help
HTH -
Mondo Regards [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.terrafox.net www.viasqlserver.net
"Rusty" <Rusty@discussions.microsoft.com> wrote in message
news:8E25B7E3-B25C-4DE1-8E6F-188A4459C0A0@microsoft.com...
> If you're using Blat and you store the sent to email address to a variable
> from a field value in a table and the from address to a variable, how do
you
> call blat to run within a form. I know you can't use the Run command,
correct?
>
> example:
> memailto = xtable.emailaddr
> memailfr = "uuuuuu@zzzz.com" *** default sender address
> The subject and attachment part are not a problem
>
>
>
> Rusty G