something wrong with the xamarin 'Send Email' example

LuisViolasLuisViolas USMember
edited March 2016 in Xamarin.Android

i tried to do the Xamarin example where they send a email

`Button button = FindViewById(Resource.Id.myButton);

        button.Click += delegate {

            var email = new Intent(Android.Content.Intent.ActionSend);
            email.PutExtra(Android.Content.Intent.ExtraEmail, new string[] { "[email protected]", "[email protected]" });
            email.PutExtra(Android.Content.Intent.ExtraCc, new string[] { "[email protected]" });
            email.PutExtra(Android.Content.Intent.ExtraSubject, "Hello Email");
            email.PutExtra(Android.Content.Intent.ExtraText, "Hello from Xamarin.Android!");
            email.SetType("message/rfc822");
            StartActivity(email);`

and i always get this error "Android.Content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND typ=message/rfc822 flg=0x1 (has clip) (has extras) }"

can someone help? i dont really know much about the Email thing

Tagged:

Answers

  • LuisViolasLuisViolas USMember

    i tried to do the Xamarin example where they send a email

    `Button button = FindViewById(Resource.Id.myButton);

            button.Click += delegate {
    
                var email = new Intent(Android.Content.Intent.ActionSend);
                email.PutExtra(Android.Content.Intent.ExtraEmail, new string[] { "[email protected]", "[email protected]" });
                email.PutExtra(Android.Content.Intent.ExtraCc, new string[] { "[email protected]" });
                email.PutExtra(Android.Content.Intent.ExtraSubject, "Hello Email");
                email.PutExtra(Android.Content.Intent.ExtraText, "Hello from Xamarin.Android!");
                email.SetType("message/rfc822");
                StartActivity(email);`
    

    and i always get this error "Android.Content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND typ=message/rfc822 flg=0x1 (has clip) (has extras) }"

    can someone help? i dont really know much about the Email thing

Sign In or Register to comment.