SRM19
asked on
Attaching files to email in .net application.
hello,
i need to look in a folder and if there are any files in the folder I need to attach all the files to an email in the .net application. can I please know how to check if any files exists in the folder and if exists then attach them to the email.
any help in this regard is appreciated.
Thanks,
SRM.
i need to look in a folder and if there are any files in the folder I need to attach all the files to an email in the .net application. can I please know how to check if any files exists in the folder and if exists then attach them to the email.
any help in this regard is appreciated.
Thanks,
SRM.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hello motocross geek,
that was real kind of you to send the code. i will try this later but I am sure it will work. thanks a lot.
that was real kind of you to send the code. i will try this later but I am sure it will work. thanks a lot.
http://msdn.microsoft.com/en-us/library/system.io.directory.aspx
This link shows how to add attachments to a MailMessage
http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.attachments.aspx
You can send a MailMessage with the SmtpClient class
http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.send.aspx