public void sendEmail(/*string destinataire, string objet, string body*/) { var emailMessenger = CrossMessaging.Current.EmailMessenger; if (emailMessenger.CanSendEmail) { var email = new EmailMessageBuilder() .To("") .Subject("") .Body("") //.WithAttachment("/storage/emulated/0/Android/data/MyApp/files/Pictures/temp/IMG_20141224_114954.jpg"); .Build(); emailMessenger.SendEmail(email); } }
public HistoryViewModel(SampleDbConnection conn, IGeofenceManager geofences, IUserDialogs dialogs, IMessaging messaging) { this.conn = conn; this.geofences = geofences; this.Reload = new Command(this.Load); this.Clear = ReactiveCommand.CreateAsyncTask(async x => { var result = await dialogs.ConfirmAsync(new ConfirmConfig() .UseYesNo() .SetMessage("Are you sure you want to delete all of your history?")); if (result) { this.conn.DeleteAll<GeofenceEvent>(); this.Load(); } }); this.SendDatabase = new Command(() => { var backupLocation = conn.CreateDatabaseBackup(conn.Platform); var mail = new EmailMessageBuilder() .Subject("Geofence Database") //.WithAttachment(conn.DatabasePath, "application/octet-stream") .WithAttachment(backupLocation, "application/octet-stream") .Body("--") .Build(); messaging.EmailMessenger.SendEmail(mail); }); }