[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[jx8Intents] Compose email


SwikiCodeRobot @> 613

"Prompt the user to send an email."
| intent context subject addresses text |
subject := 'anEmail from S8'.
addresses := #( '[email protected]' ).
text := 'Object selectors 
',Object selectors sorted asLiteral.
context := MainActivity current.
intent := Intent action: Intent actionSendto.
intent type: '*/*'.
intent data: (Uri parse: #mailto:).
intent putExtra: Intent extraEmail value: addresses.
intent putExtra: Intent extraSubject value: subject.
intent putExtra: Intent extraText value: text.
(intent resolveActivity: context packageManager) isNil ifTrue: [
	self error: 'Intent canīt be resolved'
].
context startActivity: intent.
^#Ok