Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #12225

Re: I really thought THIS would be easy

From JohnMartens <martens@tennishulp.info>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: I really thought THIS would be easy
Date 2019-02-09 16:38 +0100
Organization A noiseless patient Spider
Message-ID <q3ms58$mut$1@dont-email.me> (permalink)
References <84877301-e811-4cd2-8e3d-3f40b1e756e4@googlegroups.com>

Show all headers | View raw


How about this MAPI one


LOCAL nResult  AS DWORD
LOCAL n, nRecips, nFiles AS DWORD
LOCAL aRecips, aFiles AS PTR
LOCAL sMessage AS MAPIMessage
LOCAL sRecip   AS MAPIRecipDesc
LOCAL sFile    AS MAPIFileDesc
LOCAL dwFlags AS DWORD

*
aRecips := MemAlloc( nRecips*_SIZEOF(MAPIRecipDesc) )
aFiles  := MemAlloc( nFiles* _SIZEOF(MAPIFileDesc)  )
*
sRecip  := aRecips
FOR n:=1 UPTO nRecips
	sRecip.ulRecipClass := MAPI_TO
	sRecip.lpszName		  := StringAlloc(SELF:aRecipients[n,1] )
	sRecip.lpszAddress	:= StringAlloc( "SMTP:"+SELF:aRecipients[n,2])
	sRecip++
NEXT
*
sFile   := aFiles
FOR n:=1 UPTO nFiles
	sFile.nPosition    := 0xFFFFFFFF
	sFile.lpszPathName := StringAlloc(SELF:aFileNames[n])
	sFile++
NEXT
*
sMessage              := MemAlloc( _SIZEOF( MAPIMessage ) )
sMessage.nRecipCount  := nRecips
sMessage.lpRecips     := aRecips
sMessage.lpszSubject  := String2Psz(SELF:cSubject)
IF SELF:IsHtmlMail
	sMessage.lpszConversationID := String2Psz("MIME-Version: 1.0\r\n 
Content-type: text/html;charset=iso-8859-1\r\n")
	sMessage.lpszNoteText := String2Psz(SELF:cNoteTextHtml)
ELSE
	sMessage.lpszNoteText := String2Psz(SELF:cNoteText)
ENDIF
sMessage.nFileCount   := nFiles
sMessage.lpFiles      := aFiles
*
dwFlags := 0 // or MAPI_DIALOG for intreface
nResult := MAPISendMail( SELF:dwSession, 0, sMessage, dwFlags, 0 )
*
sRecip := aRecips
FOR n:=1 UPTO nRecips
	MemFree( sRecip.lpszName )	
	MemFree( sRecip.lpszAddress )
	sRecip++
NEXT
MemFree( aRecips )
sFile := aFiles
FOR n := 1 TO nFiles
	MemFree( sFile.lpszPathName )
	sFile++
NEXT
MemFree( aFiles )
MemFree( sMessage.lpszSubject )
MemFree( sMessage )


Op 9-2-2019 om 07:27 schreef Jeff Rollo:
> Hi all. Sorry to bug you ... again... All I want to do is click on a button to send an email using the users default email client. I then need to pass it to the TO field. Nothing else. No subject, no message, Nothing. Just a blank email with the recipients address already in place. Here's my latest in a long line of failures...
> 
> METHOD PushButton6( ) CLASS Clients
> LOCAL cEmailStr as String
> 
> cEmailStr := self:Server:FIELDGET(#CLEmail)  <- This field contains the email address I want to send to.
>    
>    run "C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE" +  "/c ipm.note /m " + self:Server:FIELDGET(#CLEmail) <- this is an Outlook specific example, but I'd need it generic i.e. for ANY default mail client.
>      
> RETURN NIL
> 
> With the above example, Outlook opens with a blank message, but the variable is in the TO field, not the variables value.
> 
> What am I missing please?
> 
> Jeff
> 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

I really thought THIS would be easy Jeff Rollo <jrollo64@gmail.com> - 2019-02-08 22:27 -0800
  Re: I really thought THIS would be easy JohnMartens <martens@tennishulp.info> - 2019-02-09 08:23 +0100
    Re: I really thought THIS would be easy Jeff Rollo <jrollo64@gmail.com> - 2019-02-09 00:09 -0800
      Re: I really thought THIS would be easy Jeff Rollo <jrollo64@gmail.com> - 2019-02-09 00:27 -0800
        Re: I really thought THIS would be easy JohnMartens <martens@tennishulp.info> - 2019-02-09 13:16 +0100
          Re: I really thought THIS would be easy Jeff Rollo <jrollo64@gmail.com> - 2019-02-09 12:55 -0800
            Re: I really thought THIS would be easy JohnMartens <martens@tennishulp.info> - 2019-02-10 09:10 +0100
  Re: I really thought THIS would be easy "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2019-02-09 13:58 +0100
    Re: I really thought THIS would be easy JohnMartens <martens@tennishulp.info> - 2019-02-09 16:21 +0100
  Re: I really thought THIS would be easy JohnMartens <martens@tennishulp.info> - 2019-02-09 16:38 +0100
  Re: I really thought THIS would be easy D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2019-02-09 20:45 +0100
  Re: I really thought THIS would be easy "Jamal" <noooospam@example.com> - 2019-02-10 11:25 -0500
    Re: I really thought THIS would be easy Jeff Rollo <jrollo64@gmail.com> - 2019-02-10 13:50 -0800
      Re: I really thought THIS would be easy "Jamal" <noooospam@example.com> - 2019-02-10 23:32 -0500
        Re: I really thought THIS would be easy Jeff Rollo <jrollo64@gmail.com> - 2019-02-10 21:33 -0800
          Re: I really thought THIS would be easy "Jamal" <noooospam@example.com> - 2019-02-11 09:27 -0500
            Re: I really thought THIS would be easy Jeff Rollo <jrollo64@gmail.com> - 2019-02-14 17:38 -0800
              Re: I really thought THIS would be easy "Jamal" <noooospam@example.com> - 2019-02-15 07:36 -0500
                Re: I really thought THIS would be easy Jeff Rollo <jrollo64@gmail.com> - 2019-02-15 04:50 -0800
  Re: I really thought THIS would be easy simon@abersoftware.co.uk - 2019-03-11 03:28 -0700
    Re: I really thought THIS would be easy Jeff Rollo <jrollo64@gmail.com> - 2019-03-13 21:14 -0700
    Re: I really thought THIS would be easy Jeff Rollo <jrollo64@gmail.com> - 2019-03-13 21:15 -0700

csiph-web