It's going to depend on a huge range of things - it could be authentication, it could be your code, it could be you are expecting something to happen that just does not occur in an ASP.NET environment.
This code to send emails works:
Sending an Email in C# with or without attachments: generic routine.[
^] - compare it with your code and verify that you do all the necessary things.
If that doesn't help, then we need to know how you are doing this - a good general description rather than a dump of your entire project!