I have a system of programs. Basically I have a service running on an External computer that listens to a network drive. When a new file is created it then goes to another directory(within that same network drive) and executes a program. The program is supposed to email that newly created file to me. It seems to work locally but not on the fileshare. I did some troubleshooting and i'm sure it gets to the piece of code that actually executes the Email App but I believe the Email App bombs out. Is it possible to email from a fileshare?
InitilizeMailMessage();
AddToAddressesToEmail(repo);
AddCCAddressesToEmail(repo);
AddBCCAddressesToEmail(repo);
AssignEmailDetails(repo);
ConstructMessage(repo, Flag);
FileStream fileStream = new FileStream(URL, FileMode.Open, FileAccess.Read);
mail.Attachments.Add(new Attachment(fileStream, SelectedFile));
//smtp.int.cecdes.net
SmtpServer = new SmtpClient(SMTPURL);
SmtpServer.Send(mail); //it seems to be bombing out here