1

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
pravprab
  • 2,301
  • 3
  • 26
  • 43
Mickey Sly
  • 429
  • 2
  • 6
  • 21
  • 2
    Could you access sent emails on your mail server? If yes, you could check the status of the message and see if it bounces back and why. – korhner Feb 12 '14 at 20:52
  • also: what is `repo` ? your code seems to have a typo in the first line. check the SmtpServer Settings too. You send with enforced SSL? Have you tried adding a Body and / or Subject? What is `SelectedFile`? overall, give more information – Vogel612 Feb 12 '14 at 20:55
  • 2
    did you look in the event viewer on that machine - there may be an error that indicates what issue you are facing. – czuroski Feb 12 '14 at 20:55
  • @Vogel612 sorry I should've removed that. Thank you all for the trouble shooting tips. I actually don't have access to the fileshare's event log. I will get incontact with my system admin and report back. Thank you. – Mickey Sly Feb 12 '14 at 21:03

0 Answers0