Outbound message format for SMS gateway

Hi All,Here is the situation, We ve an application that sends messages to mobilephones as SMS and only one SMTP server for outbound mails. When messages are sent as HTML, mobile phones dont like them and display all html tags as is in SMS message. What I want to do is when the domain is “@sms.ourdomain.com” the message will be plain text and when domain is “@ourdomin.com” mesages will be in HTML format . How can I do that , any ides ?