Definitely not. SQLyog does not provide any scripting abilities, or any programmable API. It is a MySql admin tool, the only task it is capable of automating is the synchronization of databases.
Open the email, suck the contents into mySQL, do the calculation dance, send it back out. http://www.zend.com has about a dozen or so email controls that make sending emails easier.