adsense

Thursday, September 13, 2012

send mms from sql server (only within Sri Lanka)

Most of us know that we  can send MMS messages  using gmail. For the sake of completion I ll list down the basic steps to achieve it.


1)  Compose a new mail. In the to box type your mobile number (i.e. 009477xxxxxxx@mms.dialog.lk for Dialog, 009471xxxxxxx@mms.mobitel.lk for Mobitel). I haven't tried this with the other service providers. 

2) Type in you message and send it as you are sending a normal email.

I have taken this to a one more step further by using this concept to send mms messages from SQL Server dbmail. Follow these steps


1) Create a mail profile for your gmail account using Database Mail wizard. Specify your maill account setting as follows.



2) Call the created profile inside your stored procedure ass follows.

EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'sendmail',
    @recipients = '
009477xxxxxxx@mms.dialog.lk',
    @body = 'Congrats for sending first MMS..!!.',
    @subject = 'Test MMS' ;


It will take some time to deliver sms  to the recipient. Please note that the recipients phone must support MMS for reading this message.  You can use this method to send a simple SMS without being bothered about buying a SMS gateway. 



Note: If you receive the "gmail smtp error 5.7.0" message when sending mail, try changing SMTP from smtp.gmail.com to smtp.googlemail.com 

Cheers
Happy Coding
Samitha

No comments:

Post a Comment