Send email (exchange 2007) via c#

To use this code, you need to install http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c3342fb3-fbcc-4127-becf-872c746840e1 , this will create a dll, that you need to import to the project

//connection to ExchangeServer
 try
 {
  ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);

  service.Credentials = new NetworkCredential(ssAuthentication.ssSTAuthentication.ssUsername, ssAuthentication.ssSTAuthentication.ssPassword, ssAuthentication.ssSTAuthentication.ssDomain);

  
  service.Url = new Uri(ssAuthentication.ssSTAuthentication.ssServiceUrl);

  // Create an e-mail message and identify the Exchange service.
  EmailMessage message = new EmailMessage(service);

  // Add properties to the e-mail message.
  message.From = ssSender;
  message.Subject = ssEmailSubject;
  message.Body = ssEmailDescription;
  for (int i = 0; i < ssRecipient.Length; i++)
  {
  message.ToRecipients.Add(ssRecipient[i].ssSTListOfEmails.ssEmail);
  }

  // Send the e-mail message and save a copy.
  message.Send();
 }
 catch (Exception e)
 {
 ssErrors = "The error is: " + e.ToString();
 }

1 comentários:

btcexchange disse...

Error while openingan account in Binance Support Number
Do you want to join Binance for your future trading endeavours? Are you facing issues in creating the account? Do you want to get rid of this issue? Obstacles such as these can be easily eliminated with the help of esteemed executives at Binance customer service. Dial Binance support phone number to avail best in class services. They eliminate all the issues with their experience and skills to handle any tough situation.
Website: https://www.cryptowalletsupport.com/binance-support-number/

Enviar um comentário