• The first thing I noticed was
    $filename = "20172018"
    $file= "C:\NewFolder"+$filename

    That probably doesn't give you what you expect for the full file path/name.  If you leave off the attachment can you successfully send an email?