Click here to Skip to main content
16,015,559 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear all,
i am having an application where after fill up the asp.net page click on apply button and email will fire.is it possible that after clicked on apply button and before fired email,scan that page with anti-virus.if possible please reply me with c# code n direction/suggestions.if more information required please let me know.


Thanks,
Avijit
Posted

There are some absurdities in this question. First of all, is it going on on client side or server side? I think your're talking about client side — if it was a server side, it would be your Web page, how can it contain viruses? But if this is a client side, you cannot know if it is ASP.NET page or not. From the standpoint of a client, there is not such thing as APS.NET or any other server-side technology (PHP, Python, JPS, whatever…).

Not clear what do you mean by scanning a page with anti-virus. What do you want to scan, a text file? If you download some binaries, they are not called Web pages. And again, despite the popular opinion, it is only possible to get a virus from the Web page because the Web browser does dirty things, for example, loads and execute some binary codes from Internet. Don't do it; and you won't get infected. I don't see how you can get a virus as a result of the post request. The page is already loaded and some scripts are already executed.

Anyway, it's possible to filter out suspect parts of the page right after it's loaded, but it could not be related to post request.

Not clear, what is "fire e-mail". Is your click an anchor with the "mailto:" schema, you can open some e-mail agent — locally. It has nothing to do with sending messages through the Web site. As the Web application knows nothing about client's opportunities to send mails, normally, the mail is sent on the server side. The client performs the HTTP request using "POST" method using the form containing data needed for mailing. The server gets posted data, filters it, makes a e-mail message out of it and sends using its own mail server (such as SMTP). This process could be done in a very secure way, but it needs a lot of care about filtering the data. If the e-mail is made out of client data as is, it can be easily used to turn a server into a zombie distributing spam or something like that. Proper filtering of this data can completely eliminate the possibilities for such exploits. Again, it is related to server-side Web development and has nothing to do with scanning of the Web page for viruses. It's not clear why sending a e-mail can be a special concern at the client side.

[EDIT]

Also, be aware of danger of sending e-mail based on the user input. Please see my recent answer:
unable to send mail , it showing the error in below code .[^].

—SA
 
Share this answer
 
v2
This is a stupid question. Your web page can't have a virus in it, unless you put one there. If your server has no viruses, why would you web page have one ? It seems you have no idea what a virus is, what ASP.NET is, how viruses work, etc. Run anti virus on your server, that's all you need to do, unless you're attaching a file the user provides with your email. In that case, you need to scan the file, not your asp.net page.
 
Share this answer
 
Comments
thatraja 8-Aug-11 2:50am    
[Comment from OP/Moved from Answer]
thats why i asked is it possible.
but OK thanks buddy.

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