c# - mail attachment contains corrupt file -
while sending email using c#, getting issue.
code
//profileuploadcontrol file upload command attachment fileattach = new attachment(profileuploadcontrol.postedfile.inputstream, savedfilename,profileuploadcontrol.postedfile.contenttype);
i using fileattach object parameter send email function , sending email file corrupted , no content in file. something, missing here. help appreciated.
please note code working fine if saved file in server , access path in file attach. sample :
profileuploadcontrol.saveas(server.mappath("~/en/companyprofiles/") + savedfilename); attachment fileattach = new attachment(server.mappath("~/en/companyprofiles/") + savedfilename);
but don't want save file.
c# .net
No comments:
Post a Comment