In the script below i am working out hte correct email address to send something too. but the srEmail isn't populating in the final part. i think i have set the code up wrongly as it like they don't see each other. I get an error saying it doesn't exist in this content but how do i get round that
thanks
- String myOffice = dirEntry.Properties["physicalDeliveryOfficeName"].Value.ToString();
- if (myOffice == "Leeds")
- {
- String srEmail = "[email protected]";
- }
- else if (myOffice=="Sheffield")
- {
- String srEmail = "[email protected]";
- }
- else if (myOffice =="York")
- {
- String srEmail = "[email protected]";
- }
- String Date = DateTime.Now.ToShortDateString();
- Outlook.Application app = new Outlook.Application();
- Outlook.MailItem mailItem = app.CreateItem(Outlook.OlItemType.olMailItem);
- mailItem.Subject = "New Stationary Order - " + myName + ":" + Date;
- mailItem.To = srEmail;
- string htmlString = @"<html>