public bool EnviarCorreo(YanapayEmail email) { try { GmailAPI.ConectarAPI(email); return(true); } catch (Exception ex) { Console.WriteLine(ex.Message.ToString()); return(false); } }
public string EnviarCorreoString(string subject, string body, string recipient) { try { YanapayEmail email = new YanapayEmail() { FromAddress = "*****@*****.**", ToRecipients = recipient, Subject = subject, Body = body, IsHtml = false }; GmailAPI.ConectarAPI(email); return("enviado"); } catch (Exception ex) { return(ex.Message.ToString()); } }