Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Net.Mail;
- using Arquitetura.SOLID.DIP.Solucao.Interfaces;
- namespace Arquitetura.SOLID.DIP.Solucao
- {
- public class EmailServices : IEmailServices
- {
- public bool IsValid(string email)
- {
- return email.Contains("@");
- }
- public void Enviar(string de, string para, string assunto, string mensagem)
- {
- var mail = new MailMessage(de, para);
- var client = new SmtpClient
- {
- Port = 25,
- DeliveryMethod = SmtpDeliveryMethod.Network,
- UseDefaultCredentials = false,
- Host = "smtp.google.com"
- };
- mail.Subject = assunto;
- mail.Body = mensagem;
- client.Send(mail);
- }
- }
- }
Add Comment
Please, Sign In to add comment