public static void SendSampleEmail(this IEmailTask emailTask, IEmailMessage email) { if (emailTask.CanSendEmail) { emailTask.SendEmail(email); } }
void OnSendEmail() { if (_emailTask.CanSendEmail) { _emailTask.SendEmail("*****@*****.**", "Applied Behavioral Health Counseling Support"); } }
private async void SendEmail_Tapped(object sender, EventArgs e) { try { IEmailTask emailMessenger = CrossMessaging.Current.EmailMessenger; if (emailMessenger.CanSendEmail) { emailMessenger.SendEmail(client.Email, "", ""); } } catch (Exception ex) { await DisplayAlert("Ошибка", ex.Message, "OK"); } }
private void ClickMail(Mail mail) { if (mail == null) { return; } ActionSheetConfig config = new ActionSheetConfig(); config.Add(ResourceService.GetString("messageAction"), () => { IEmailTask emailMessenger = CrossMessaging.Current.EmailMessenger; if (!emailMessenger.CanSendEmail) { UserDialogs.Instance.Alert(ResourceService.GetString("cannotMail")); return; } emailMessenger.SendEmail(mail.Address); }); config.Add(ResourceService.GetString("editAction"), () => { EditMail(mail); }); config.Add(ResourceService.GetString("deleteAction"), () => { if (Debtor == null || Debtor.Mails.IsNullOrEmpty()) { return; } UserDialogs.Instance.Confirm(ResourceService.GetString("reallyDelete"), ResourceService.GetString("yes"), ResourceService.GetString("no"), (accepted) => { if (accepted) { Debtor.Mails.Remove(mail); } }); }); config.Add(ResourceService.GetString("cancelAction")); UserDialogs.Instance.ActionSheet(config); }
private void ClickMail(Mail mail) { if (mail == null) { return; } ActionSheetConfig config = new ActionSheetConfig(); config.Add(ResourceService.GetString("messageAction"), () => { IEmailTask emailMessenger = CrossMessaging.Current.EmailMessenger; if (!emailMessenger.CanSendEmail) { UserDialogs.Instance.Alert(ResourceService.GetString("cannotMail")); return; } emailMessenger.SendEmail(mail.Address); }); config.Add(ResourceService.GetString("cancelAction")); UserDialogs.Instance.ActionSheet(config); }
private async void Share() {//check permissions var status = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.Storage); if (status != PermissionStatus.Granted) { //if (await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.Location)) //{ // var tr = new TranslateExtension(); // await DisplayAlert(tr.GetTranslation("QuestionLabel"), "Gunna need that location", "OK"); //} var results = await CrossPermissions.Current.RequestPermissionsAsync(Permission.Storage); //Best practice to always check that the key exists if (results.ContainsKey(Permission.Storage)) { status = results[Permission.Storage]; } } if (status == PermissionStatus.Granted) { IEmailTask emailMessenger = null; try { emailMessenger = CrossMessaging.Current.EmailMessenger; } catch (Exception ex) { await _pageDialogService.DisplayAlertAsync("", ex.ToString(), "OK"); } if (emailMessenger.CanSendEmail || 1 == 1) { try { var logo = @" <img alt='' src='data: image / png; base64,iVBORw0KGgoAAAANSUhEUgAAASwAAABjCAYAAAAhBD14AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAqz0lEQVR4Xu2dB5wURfbH38wGYInLCkpWOEFPMIGHkSCCWUD0FO9Q8FDvRDxETICg / jkVA3ieqICCICZUEBAQQQUxkuFOQckGYHeJuyxsmql//Wqrd3p6qnt64rJsff2UdJrenp7q169eveBhHNJoNJoKYN++fXTkyBGCGMrIyKATTjhB7lGjBZZGo0k6H330Ef36669CSKWkpIhtpaWldPToUfJ6vTRo0CCxzYoWWBqNJqmce+659PDDD9NZZ51FzZo1E0ILQFj99ttvtH//fho5ciT95z//odNOO03sM9ACS6PRJIUff/yR+vbtS+vXr5dbnLnzzjupR48edMMNN8gtRF75r0aj0SQM2KrGjx9PK1askFvCM2nSJFq8eDFt3LhRbtEalkajSQIPPvgg/e1vf6M2bdrILe657LLLaMmSJWJZCyyNRpNQSkpK6K677qIpU6bILWXs2bNHaE8wtsPwnpmZSeecc47cG2D16tX0zTff0ODBg/WQUKPRJJZ77rmHJk+eLNcCPP300/TnP/+Z5syZQzNnzqRevXrRO++8I/cGqFOnjpg5BFpgaTSahJKXl1fuumAGmhWE2UsvvUSvvvoqzZgxg6ZNmyb3BmjatCm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jUmCmTOnj1bnOfyyy9nu3btEkHPKlAIVlWBGBkX+FteHuUMAo2txUaRsgXVmPG3kXli48aN5RWx+VBKfjIycB5rJWgucMR3c3utKpDqxTgf0t4gkwHSyuDeIw2LOaMD0tvk5eXJT4YH14XrsxY2xb3gw2J5VABrqiE0LshYUVGRPMIZ4z4sX7485DdB9W4Qy71yQifwO86Bhzn8rOAtjZkiQ3uAbw/CZzp37ixm96AlOZE90UOZ131O6Y26ioR2jz76qHBGxLAH0/WYyoZrBJLnmd+yCNWB1zcK7pqNtLB/YEZs6NCh4g2v8sq2guEnPOhxLpzTAOc1tAnE4uF8HTt2FOtuQWgSiuzCpgPDt6GR4vGARgStDr5lsNdFCyYlMBxGfCC0NhjDYZhftmyZuB/4G/CXQvykW00FQcYvvfSSmIyAg6jZXogkjBdccIG4F4hkMLQ1zB4ifAqRCbh3+Nv4TRH7CMdPc1iVigkTJginVJgCuOAt19RxHrRu3bqJ+qPDhw935SwbCVpgHecg0yMeZnRCq/qO7XAVwENjl5UTlOxbSwfnXUgN+pcNjfAAo7PD89w4J4QPzteyZcugKXTYkiAc8TesQy1sx7lQkDQSOxG89CFU8Fk8sLgOPOAQnvj70QABgsKpuE9WYWEIV8xSRhIaZAeEIyYEIOiR5RQPNWYDMYSN1JET9xC/MQS+KqwH9wr3CUNkCCcDDB/xt437jmNwD/BbmI9Tgb+HvwuhbjUrcM1K3CsIQIQiuXkRRYIWWJqwFKwdRb69q6lO9+gyLmg08cL9a01TZSn6ZS5VV7gzaDTJRgssTVj8eZuF7UqjqWi0wNI44svfSelNr5RrGk3FogWWxhH/0V1UvU1oRkmNpiLQRneNIwzVnRWZRTWa5EP0/6i6py21MlTpAAAAAElFTkSuQmCC'>"; var defekti = App.Database.GetDefekti(DefektacijasAkts.Id).Result.ToList().OrderBy(x => x.DefektaNr).ToList(); var tmp = App.Database.GetProfile().Result; if (tmp.Count > 0) { App.Profils = tmp[0]; } else { App.Profils = new Models.Settings(); } if (!string.IsNullOrWhiteSpace(App.Profils.Logo)) { logo = $"<img alt='' src='data: image/png;base64, {App.Profils.Logo}' />"; } var kopa = defekti.Count; var horiz = defekti.Where(x => x.Novietojums == 1).Count(); var vert = defekti.Where(x => x.Novietojums == 2).Count(); Stream stream; var numurs = ""; var desc = ""; var assembly = IntrospectionExtensions.GetTypeInfo(typeof(IerakstsViewModel)).Assembly; switch (App.Profils.Valoda) { case "LV": stream = assembly.GetManifestResourceStream("ControlitFactory.Reportlv.txt"); numurs = "Defekts numur"; desc = "Defekta attēls"; break; default: stream = assembly.GetManifestResourceStream("ControlitFactory.Reporten.txt"); numurs = "Defect number"; desc = "Defect picture"; break; } string text = ""; using (var reader = new System.IO.StreamReader(stream, Portable.Text.Encoding.UTF8)) { text = reader.ReadToEnd(); } var sb = new StringBuilder(); foreach (var item in defekti) { var name = System.IO.Path.GetFileName(item.FilePath); sb.AppendLine($" {numurs}: {item.DefektaNr}, {desc} <a href='{name}'> {name} </a> {(string.IsNullOrWhiteSpace(item.Piezimes) ? "" : "(" + item.Piezimes + ")")} </br>"); } var email = new EmailMessageBuilder() .To("") .Cc(DefektacijasAkts.Epasts) .Subject("Defektācijas akts") .BodyAsHtml(""); var temp = text.Replace("$AN$", DefektacijasAkts.AktaNr) .Replace("$AD$", DefektacijasAkts.Adrese) .Replace("$NK$", App.Profils.UznemumaDati) .Replace("$MT$", App.Profils.Currency) .Replace("$TEL$", DefektacijasAkts.Talrunis) .Replace("$MAIL$", DefektacijasAkts.Epasts) .Replace("$HWIDN$", DefektacijasAkts.HighVoltageEquipmentName) .Replace("$HWIDS$", DefektacijasAkts.HighVoltageEquipmentSerial) .Replace("$LWIDN$", DefektacijasAkts.LowVoltageEquipmentName) .Replace("$LWIDS$", DefektacijasAkts.LowVoltageEquipmentSerial) .Replace("$CEAM$", DefektacijasAkts.IekartasKalibracija) .Replace("$WMT$", DefektacijasAkts.MembranasVeids) .Replace("$WMN$", DefektacijasAkts.MembranasNosaukums) .Replace("$WMT$", DefektacijasAkts.MembranasBiezums) .Replace("$PLA$", DefektacijasAkts.ParbaudamaPlatiba.ToString()) .Replace("$TIZD$", DefektacijasAkts.TransportaIzdevumi.ToString()) .Replace("$DIAG$", DefektacijasAkts.Diagnostika.ToString()) .Replace("$VAT$", DefektacijasAkts.Vat.ToString()) .Replace("$TOT$", DefektacijasAkts.Kopa.ToString()) .Replace("$UZS$", DefektacijasAkts.ParbaudeUzsakta.ToShortDateString() + " " + DefektacijasAkts.ParbaudeUzsakta.ToShortTimeString()) .Replace("$PAB$", DefektacijasAkts.ParbaudePabeigta.ToShortDateString() + " " + DefektacijasAkts.ParbaudePabeigta.ToShortTimeString()) .Replace("$KST$", DefektacijasAkts.LaiksKopa.ToString()) .Replace("$HO$", horiz.ToString()) .Replace("$VE$", vert.ToString()) .Replace("$KE$", kopa.ToString()) .Replace("$DE$", sb.ToString()) .Replace("$VUS$", DefektacijasAkts.ParbaudiVeica) .Replace("$LOGO$", logo) .Replace("$PVU$", DefektacijasAkts.PasutitajaParstavis + " <img alt='' src='data:image/png;base64," + DefektacijasAkts.Paraksts + "' />"); var fi = Xamarin.Forms.DependencyService.Get <ISaveAndLoad>().SaveText("report.html", temp); email.WithAttachment(fi, "report"); foreach (var item in defekti) { if (!string.IsNullOrWhiteSpace(item.FilePath)) { email.WithAttachment(item.FilePath, "image"); } } var m = email.Build(); emailMessenger.SendEmail(m); } catch (Exception ex) { throw; } } } }