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


Groups > comp.lang.clipper.visual-objects > #12218 > unrolled thread

I really thought THIS would be easy

Started byJeff Rollo <jrollo64@gmail.com>
First post2019-02-08 22:27 -0800
Last post2019-03-13 21:15 -0700
Articles 20 on this page of 22 — 6 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  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

Page 1 of 2  [1] 2  Next page →


#12218 — I really thought THIS would be easy

FromJeff Rollo <jrollo64@gmail.com>
Date2019-02-08 22:27 -0800
SubjectI really thought THIS would be easy
Message-ID<84877301-e811-4cd2-8e3d-3f40b1e756e4@googlegroups.com>
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

[toc] | [next] | [standalone]


#12219

FromJohnMartens <martens@tennishulp.info>
Date2019-02-09 08:23 +0100
Message-ID<q3lv6a$r3m$1@dont-email.me>
In reply to#12218
Do not use sending mails often anymore so do not know wether this works

John

		*
		* ShelleExecute
		cShell += 'mailto:'
		*
		* adres
		FOR n := 1 UPTO ALen(SELF:aRecipients)
			IF n > 1
				cShell += '; '
			ENDIF
			cShell += SELF:aRecipients[n,2]
		NEXT
		*
		* subject
		cShell += '?Subject='+SELF:cSubject
		*
		* body
		cShell += CHR(38)+'Body='+SELF:cNoteText
		*
		* send
		BEGIN SEQUENCE
			IF ShellExecute(NULL, String2Psz("open"), String2Psz(cShell), 
NULL_PSZ, NULL_PSZ, SW_SHOWNORMAL) == NULL_PTR
				nResult := SUCCESS_SUCCESS + 1
				// error
			ELSE
				nResult := SUCCESS_SUCCESS
			ENDIF
		RECOVER
			nResult := SUCCESS_SUCCESS + 1
			// error
		END SEQUENCE



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
> 

[toc] | [prev] | [next] | [standalone]


#12220

FromJeff Rollo <jrollo64@gmail.com>
Date2019-02-09 00:09 -0800
Message-ID<c509b31b-13df-4900-9a6f-f3a1927c5f43@googlegroups.com>
In reply to#12219
Thanks very much John, I'll give it a shot!

[toc] | [prev] | [next] | [standalone]


#12221

FromJeff Rollo <jrollo64@gmail.com>
Date2019-02-09 00:27 -0800
Message-ID<ee2b1719-1966-44d6-9037-0b799384ece8@googlegroups.com>
In reply to#12220
No, no good John. Thank you anyway.

[toc] | [prev] | [next] | [standalone]


#12222

FromJohnMartens <martens@tennishulp.info>
Date2019-02-09 13:16 +0100
Message-ID<q3mga1$g9s$1@dont-email.me>
In reply to#12221
Whats wrong with it ?

Op 9-2-2019 om 09:27 schreef Jeff Rollo:
> No, no good John. Thank you anyway.
> 

[toc] | [prev] | [next] | [standalone]


#12228

FromJeff Rollo <jrollo64@gmail.com>
Date2019-02-09 12:55 -0800
Message-ID<fa3b3983-5665-431d-96da-306a4e6465a3@googlegroups.com>
In reply to#12222
It's no doubt something I'M doing wrong John - variable declarations maybe? but it doesn't want to comnpile...

[toc] | [prev] | [next] | [standalone]


#12229

FromJohnMartens <martens@tennishulp.info>
Date2019-02-10 09:10 +0100
Message-ID<q3om94$6sa$1@dont-email.me>
In reply to#12228
Probably because it was taken out more of my code.

What compiler errors do you get ?

Op 9-2-2019 om 21:55 schreef Jeff Rollo:
> It's no doubt something I'M doing wrong John - variable declarations maybe? but it doesn't want to comnpile...
> 

[toc] | [prev] | [next] | [standalone]


#12223

From"Urs Eggmann" <Urs.Eggmann@shinternet.ch>
Date2019-02-09 13:58 +0100
Message-ID<gc814iFdcsuU1@mid.individual.net>
In reply to#12218
Hi Jeff,

In the VO Samples is a EMail Client. If you analyse this code you will 
probably find some hints for your problem?

Regards
Urs


"Jeff Rollo" <jrollo64@gmail.com> schrieb im Newsbeitrag 
news:84877301-e811-4cd2-8e3d-3f40b1e756e4@googlegroups.com...
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 

[toc] | [prev] | [next] | [standalone]


#12224

FromJohnMartens <martens@tennishulp.info>
Date2019-02-09 16:21 +0100
Message-ID<q3mr6k$ghg$1@dont-email.me>
In reply to#12223
This example class worked fine for me in last century these days 
mailclients do not like it because of security stettings
Probably because of spam ?


Op 9-2-2019 om 13:58 schreef Urs Eggmann:
> Hi Jeff,
> 
> In the VO Samples is a EMail Client. If you analyse this code you will 
> probably find some hints for your problem?
> 
> Regards
> Urs
> 
> 
> "Jeff Rollo" <jrollo64@gmail.com> schrieb im Newsbeitrag 
> news:84877301-e811-4cd2-8e3d-3f40b1e756e4@googlegroups.com...
> 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

[toc] | [prev] | [next] | [standalone]


#12225

FromJohnMartens <martens@tennishulp.info>
Date2019-02-09 16:38 +0100
Message-ID<q3ms58$mut$1@dont-email.me>
In reply to#12218
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
> 

[toc] | [prev] | [next] | [standalone]


#12226

FromD.J.W. van Kooten <vankooten@removethis.ic2.com>
Date2019-02-09 20:45 +0100
Message-ID<c7bu5e1rt9gdd6phgeu93j173s2gjd8ci6@4ax.com>
In reply to#12218
Replying on message of Fri, 8 Feb 2019 22:27:06 -0800 (PST) from Jeff
Rollo:


 Hello Jeff,

>  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.
>    
>
>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?
>
I've not used it like this but the example on

https://support.microsoft.com/en-us/help/312346/a-new-mail-message-window-does-not-open-when-you-click-a-mailto-link-o
shows:

"C:\Program Files\Microsoft Office\Office10\OUTLOOK.EXE" -c IPM.Note
/m "%1"

I think you must suround the e-mail address with quotes which you can
provide like this:

"'" + alltrim(self:Server:FIELDGET(#CLEmail))+"'"

Dick

[toc] | [prev] | [next] | [standalone]


#12233

From"Jamal" <noooospam@example.com>
Date2019-02-10 11:25 -0500
Message-ID<q3pj95$3eo$1@news.albasani.net>
In reply to#12218
This works:

local command1 := [mailto:yyyy@example.com?subject=Hello 
there&bcc=zzzz@example.com&body=test] as string

   ShellExecute(null_ptr, String2Psz("open"), String2Psz(command1), 
null_ptr, null_ptr, SW_SHOW)

Of course, you need to create your own string based on variables.

Note the use of [  ] to surround the string.

Jamal

"Jeff Rollo"  wrote in message 
news:84877301-e811-4cd2-8e3d-3f40b1e756e4@googlegroups.com...

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 

[toc] | [prev] | [next] | [standalone]


#12235

FromJeff Rollo <jrollo64@gmail.com>
Date2019-02-10 13:50 -0800
Message-ID<170bf338-c47f-4790-b5d9-79751ba6e086@googlegroups.com>
In reply to#12233
Hi Jamal, yes thank you, that does work, but I'm left with my original problem. How to I retrieve a field value (CLEmail), and use it as the to address in your example?

[toc] | [prev] | [next] | [standalone]


#12236

From"Jamal" <noooospam@example.com>
Date2019-02-10 23:32 -0500
Message-ID<q3qttg$qvh$1@news.albasani.net>
In reply to#12235
I thought I was clear when I said: "Of course, you need to create your own 
string based on variables.".

Anyway, here we go:

LOCAL cCommand1 AS STRING
LOCAL cSubject := "", cBCC := "", cBody := "" AS STRING

// pass the variable: CLEmail

cCommand1 := [mailto:] + CLEmail

// cCommand1 := [mailto:] + CLEmail   + [?subject=] + cSubject + [&bcc=] + 
cBCC + [&body=] + cBody     // another sample with additional parameters


ShellExecute(null_ptr, String2Psz("open"), String2Psz(command1), null_ptr, 
null_ptr, SW_SHOW)

Jamal

"Jeff Rollo"  wrote in message 
news:170bf338-c47f-4790-b5d9-79751ba6e086@googlegroups.com...

Hi Jamal, yes thank you, that does work, but I'm left with my original 
problem. How to I retrieve a field value (CLEmail), and use it as the to 
address in your example? 

[toc] | [prev] | [next] | [standalone]


#12237

FromJeff Rollo <jrollo64@gmail.com>
Date2019-02-10 21:33 -0800
Message-ID<7fdd0b50-fa27-4162-a6c4-cfa3af48999c@googlegroups.com>
In reply to#12236
Brilliant! Thank you Jamal very much. I knew what you meant about creating the variable, what I didn't know was how to extract the information I needed to get the desired result. That code you just sent clarified where I was going wrong. Thank you so much again!

Jeff

[toc] | [prev] | [next] | [standalone]


#12241

From"Jamal" <noooospam@example.com>
Date2019-02-11 09:27 -0500
Message-ID<q3s0p9$qem$1@news.albasani.net>
In reply to#12237
Glad to be of help!

Jamal

"Jeff Rollo"  wrote in message 
news:7fdd0b50-fa27-4162-a6c4-cfa3af48999c@googlegroups.com...

Brilliant! Thank you Jamal very much. I knew what you meant about creating 
the variable, what I didn't know was how to extract the information I needed 
to get the desired result. That code you just sent clarified where I was 
going wrong. Thank you so much again!

Jeff 

[toc] | [prev] | [next] | [standalone]


#12258

FromJeff Rollo <jrollo64@gmail.com>
Date2019-02-14 17:38 -0800
Message-ID<190deb12-17ac-40bc-8c06-0afeb8957b8f@googlegroups.com>
In reply to#12241
Typical... You tell your client you got the email problem sorted, then they add another request... 

Jamal in your example, how do I attach an attachment? Can it be done please?

[toc] | [prev] | [next] | [standalone]


#12260

From"Jamal" <noooospam@example.com>
Date2019-02-15 07:36 -0500
Message-ID<q46bnp$kv1$1@news.albasani.net>
In reply to#12258
The answer is NO.

See: 
https://stackoverflow.com/questions/5233556/using-mailto-to-send-email-with-an-attachment

If your client wants more power use a third party activeX mail component.



"Jeff Rollo"  wrote in message 
news:190deb12-17ac-40bc-8c06-0afeb8957b8f@googlegroups.com...

Typical... You tell your client you got the email problem sorted, then they 
add another request...

Jamal in your example, how do I attach an attachment? Can it be done please? 

[toc] | [prev] | [next] | [standalone]


#12261

FromJeff Rollo <jrollo64@gmail.com>
Date2019-02-15 04:50 -0800
Message-ID<66b684f4-0968-45ac-b8f1-904ecc2fcc5d@googlegroups.com>
In reply to#12260
Cool. Thanks very much Jamal ... again :)

[toc] | [prev] | [next] | [standalone]


#12320

Fromsimon@abersoftware.co.uk
Date2019-03-11 03:28 -0700
Message-ID<fd809aac-d7e9-4bdd-8fb4-658d6bd47177@googlegroups.com>
In reply to#12218
Hi Jeff,

Did you get your email stuff working....

I link to Outlook to send emails, with attachments etc. They then appear in users normal sent items etc.

Let me know if you want some code / example.

Simon



On Saturday, February 9, 2019 at 6:27:07 AM UTC, Jeff Rollo wrote:
> 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

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web