Why are you actually debugging the method, if you already know that it works from workflow (that should be all that matters)?
Few things to check:
- Does your own user have email address maintained in SU01? It might be that the email sending logic needs the sender to have email address too. When the workflow executes the task, everything is done by WF-BATCH user.
- Are you sure that the parameters are passed properly to the method? Did you click the variables in the debugging session, and made sure that they really have the required values?
Sometimes some functions & methods (whatever block of code) of SAP do not work when you test them, even if they work in the real life scenario. For example just last week I was testing a function from SE37 and wondering why it doesn't work as it should. Eventually I just found out that it does not work from SE37 (unless I cleared certain system variable in debugger). Most probably you are not having a similar issue, but worth to note...
Regards,
Karri