John Weller wrote:
> Can anyone recommend a *simple* book on this area which doesn't assume any
> prior knowledge?  I don't even know what Winsock means or implies but can
> nod sagely in the appropriate places (more or less) when it is mentioned.
>
Hi John,

Here's a simple example of using blat.  I put it in a program called 
testblat and run it till it works.  If you can get someone to set up an 
email account you can send from, then you can put these values in the 
code below and use it.  I had to tweak it a bit to get it working but 
now it works great.  All you need is this bit of code and the DLL

HTH

Peter

cEmailto='[EMAIL PROTECTED]'
cCCto=''
cBCCto=''
lcResult = "FAILED"
cEmailSubject='this is the subject of a test email'
cEmailFrom='emailaddressusedtosend'
cAttach='c:\images\this is a long name.jpg'

cEmailbody='this is the body'
lcFile='xtradata.dir'    && just a dummy file - does not get sent

IF !EMPTY(cAttach)
   cAttach = [ -attach ] + '"'+cAttach+'"'
ENDIF

        lcSend =  lcFile + ;
         IIF(EMPTY(cEmailto),'',[ -to ] + Chr(34) + AllTrim(cEmailTo) + 
Chr(34)) + ;
         IIF(EMPTY(cCCto),'',[ -cc ] + Chr(34) + AllTrim(cCCTo) + 
Chr(34)) + ;
         IIF(EMPTY(cBCCto),'',[ -bcc ] + Chr(34) + AllTrim(cBCCTo) + 
Chr(34)) + ;
         [ -subject ] + Chr(34) + AllTrim(cEmailSubject) + Chr(34) + ;
         [ -f fullemailaddressofaccount] + ;
         [ -replyto ] + Chr(34) + AllTrim(cEmailFrom) + Chr(34) + ;
         [ -server 192.168.0.9] + ;
         [ -body ] + Chr(34) + AllTrim(cEmailBody) + Chr(34) + ;
         [ -u ] + Chr(34) + "emailaccountname" + Chr(34) + ;
         [ -pw ] + Chr(34) + "emailpassword" + Chr(34) + ;
         cAttach


Declare Integer Send In system\blat.DLL STRING blatstring

lcSendCmd = "Send(lcSend)"

        If &lcSendCmd == 0
            WAIT WINDOW "Success"
        ELSE
            WAIT WINDOW  "Failed to Send"
        ENDIF




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to