Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
I want to add email functionality to my blog using C# ASP.NET. But the problem is I want to add auto add functionality on click event of particular blog.
(So that file can be automatically added to the email.) How to do that, please give some valuable suggestions.


explanation: Suppose i have website (contains blog) and there is a mail option after every blog. So if some click on mail option then the content of that blog gets auto attached with email. content can be a image file, pdf, doc anything.
I want to know how to do that using C# ASP.NET.
Posted
Updated 25-Aug-14 20:43pm
v2
Comments
[no name] 26-Aug-14 2:37am    
i can't get u..
Abhishek Jaiswall 26-Aug-14 2:42am    
My question is-
how to attach content to the mail automatically.
explanation: Suppose i have website (contains blog) and there is a mail option after every blog. So if some click on mail option then the content of that blog gets auto attached with email. content can be a image file, pdf, doc anything.
I want to know how to do that using C# ASP.NET.
Abhishek Jaiswall 26-Aug-14 2:43am    
I hope now you will be getting my query!

1 solution

All you need can be found in .NET FCL. Please start here:
http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage%28v=vs.110%29.aspx[^].

I hope your ASP.NET hosting provides you with the access to a SMTP server; I never heard of hosting packages without this feature.

—SA
 
Share this answer
 
Comments
Abhishek Jaiswall 26-Aug-14 4:25am    
Is code snippet mentioned in this link, going to auto add content in the mail?
Sergey Alexandrovich Kryukov 26-Aug-14 10:20am    
What do you mean "add"?
One class represents the whole mail message, another one sends it.
—SA
Abhishek Jaiswall 27-Aug-14 0:23am    
I mean auto attach content on click.
(without using any upload or browse button)
Sergey Alexandrovich Kryukov 27-Aug-14 0:27am    
What is "auto" attach. Why attach? Do you really know what "attach" is? Nothing is really "attached". All attachments are parts of one single e-mail. Look, I gave you two links where you can find all you need for sending any content via e-mail and SMPT server. What else would you possibly need?
—SA
Abhishek Jaiswall 27-Aug-14 2:37am    
explanation: Suppose i have website (contains blog) and there is a Email option after every blog. So if someone click on Email option then the content of that blog gets automatically gets attached with email. content can be a image file, pdf, doc anything.
I want to know how to do that using C# ASP.NET.
I hope now you will be getting my query.
Thanks.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900