//Send Email Invoices private int sendEmail(Invoices invoices) { All_Clients client = clients.GetById(Convert.ToInt32(invoices.IdClient)); if (client.Email != null) { String credit; if (Convert.ToDateTime(invoices.LimitDate).Date == DateTime.Now.Date) { credit = "contado,"; } else { credit = "credito, con fecha a cancelar el " + Convert.ToDateTime(invoices.LimitDate).ToShortDateString(); } String subject = "Productos Alimenticios Santa Marta Factura: " + invoices.Code; String body = "Factura a " + credit + " realizada el " + DateTime.Now.ToShortDateString() + " con el numero " + invoices.Code + " por un monto de ₡" + invoices.Total; int state = emails.SendEmail(client.Email, subject, body); return(state); } return(400); }
public int SendEmail(String toEmail, String subJect, String body) { return(emailsAccess.SendEmail(toEmail, subJect, body)); }