Click here to Skip to main content
15,887,083 members
Articles / Programming Languages / C#

Sending an Email in C# with or without attachments: generic routine.

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
8 Mar 2011CPOL 21.8K   2  
These are the same classes in VB.NET in case needed.I've also made the mail server address a parameter to allow the code to be runnable on copy paste.The problem while sending the bigger files was the smtp client's timeout(default 100s). I've made this dependent on the attachments' size...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Student
India India
Hariharan leapt into the field of programming after being introduced to C in his second year at college. A fan of basketball and chess, the logical thought process behind programming and the concepts of linking real principles onto a concrete platform pushed him deep into this field. On finishing his bachelor's majoring in Electrical and Electronics engineering with Soft Computing, Numerical Analysis and Biomedical Engineering as minor, he did a six month stint at India's second largest IT company- Infosys Technologies. He left Infosys armed with strong concepts of SDL Cycles and process development, gained domain knowledge in Java and had explored Visual basic, C++, C# and kept his mind open for more. Currently working in a startup as the product designer, his arsenal of technologies has doubled to accommodate the challenges his job demands.
Off work, he enjoys learning new languages (non-programming) and is currently teaching himself German and Spanish. He also enjoys travelling around and exploring new ideas, places and relationships.

Currently attempting to extend his education to post graduation.

Comments and Discussions