Android Question found the right sample - one issue to solve and it be perfect for me

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
hi

found this piece of code
it seems to be the only one that opens the email intent only and not all sharing apps - that's exactly what i was looking for

the only problem i have now is

how do i add CC & BCC?
and how to i add an attachment? (will the attachment cause the intent to fail again and open all sharing apps?)

thanks...

B4X:
    Dim in As Intent
    
        in.Initialize("android.intent.action.SENDTO", "mailto:")

        in.PutExtra("android.intent.extra.EMAIL", Array As String("aaa@bbb.com"))
    
        in.PutExtra("android.intent.extra.SUBJECT", "this is the subject")
            
        in.PutExtra("android.intent.extra.TEXT", "this is the body")
                    
        StartActivity(in)
 

agraham

Expert
Licensed User
Longtime User

EXTRA_BCC​

Added in API level 1

public static final String EXTRA_BCC
A String[] holding e-mail addresses that should be blind carbon copied.

Constant Value: "android.intent.extra.BCC"

EXTRA_CC​

Added in API level 1

public static final String EXTRA_CC
A String[] holding e-mail addresses that should be carbon copied.

Constant Value: "android.intent.extra.CC"
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…