Jump to content

Envio de email


Saragoca
 Share

Recommended Posts

Olá a todos

tenho numa das minha aplicações uma classe para envio de email

tudo corria bem até que agora começaram a surgir emais que não pertencem ao mesmo grupo -@Empresa1.pt e -@empresa2.com

para o email do outro grupo dá-me mesnagem de erro

estou a utilizar o seguinte :

objEmail.SubjectEncoding = Encoding.GetEncoding("ISO-8859-1");

objEmail.BodyEncoding = Encoding.GetEncoding("ISO-8859-1");

alguem me pode ajudar?

Link to comment
Share on other sites

sim

Assunto = " Avaria de " + Equipamento;

Corpo = "O Elementos " + Equipamento + " avariou s " + DateTime.Now + " OBSERVAO: " + Observacao;

objEmail.From =new MailAddress("emailenvio@empresa1.pt");

objEmail.To.Add("-1-@empresa1.pt");

objEmail.To.Add("-2-@empresa1.pt");

objEmail.To.Add(-3-@empresa2.com);

objEmail.Priority = MailPriority.High;

objEmail.IsBodyHtml = true;

objEmail.Subject = Assunto;

objEmail.Body = Corpo;

objEmail.SubjectEncoding = Encoding.GetEncoding("ISO-8859-1");

objEmail.BodyEncoding = Encoding.GetEncoding("ISO-8859-1");

SmtpClient objSmtp = new SmtpClient();

objSmtp.Host = "webmail.empresa1.pt";

objSmtp.Credentials = new NetworkCredential("username", "password");

objSmtp.Send(objEmail);

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.