RSS Feed for This PostCurrent Article

Send vCard, vCalendar and WAP Push Message


Download Source Code

In the previous blogs, I showed you how to retrieve phone settings, send and receive SMS, dial a phone number, and answer or hang up a phone call using the .NET SMS library. Now I am going to show you how to send vCard, vCalendar and WAP push message. Take note that sending WAP push message is not fully tested and it may not work in your environment.

phonemsg.jpg

vCard is nothing but a SMS in a specific format. Try using the sample project attached in this article to send a vCard. You should be able to see the vCard message format displayed in the text box after you sent it. If the receiving mobile phone supports vCard, then it can be saved straight away into the contact list.

//SCKE2 BEGIN:VCARD
VERSION:2.1
N:Magic Source;;;;
ORG:;
EMAIL;INTERNET:magic_opensource@hotmail.com
TEL;PREF;CELL;VOICE:0192292309
REV:00010101T000000Z
END:VCARD

Same thing goes for vCalendar, which is also SMS in a specific format.

//SCKE4 BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
UID:
SUMMARY:Test Summary
ORGANIZER:Test Org
LOCATION:
DTSTART:00010101T000000Z
DTEND:00010101T000000Z
DTSTAMP:20061214T141408Z
DESCRIPTION:
END:VEVENT
END:VCALENDAR

For WAP push message the message format is more complicated and it is not fully tested on all handsets for the SMS library. Basically for a WAP push message a link and a message are required. You can refer the sample code below.

Imports ATSMS
Imports ATSMS.SMS

Public Class MainForm

Private WithEvents oGsmModem As New GSMModem

Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CheckForIllegalCrossThreadCalls = False
End Sub

Private Sub btnPhone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConnect.Click

If cboComPort.Text = String.Empty Then
MsgBox(“COM Port must be selected”, MsgBoxStyle.Information)
Return
End If

oGsmModem.Port = cboComPort.Text

If cboBaudRate.Text <> String.Empty Then
oGsmModem.BaudRate = Convert.ToInt32(cboBaudRate.Text)
End If

If cboDataBit.Text <> String.Empty Then
oGsmModem.DataBits = Convert.ToInt32(cboDataBit.Text)
End If

If cboStopBit.Text <> String.Empty Then
Select Case cboStopBit.Text
Case “1″
oGsmModem.StopBits = Common.EnumStopBits.One
Case “1.5″
oGsmModem.StopBits = Common.EnumStopBits.OnePointFive
Case “2″
oGsmModem.StopBits = Common.EnumStopBits.Two
End Select
End If

If cboFlowControl.Text <> String.Empty Then
Select Case cboFlowControl.Text
Case “None”
oGsmModem.FlowControl = Common.EnumFlowControl.None
Case “Hardware”
oGsmModem.FlowControl = Common.EnumFlowControl.RTS_CTS
Case “Xon/Xoff”
oGsmModem.FlowControl = Common.EnumFlowControl.Xon_Xoff
End Select
End If

Try
oGsmModem.Connect()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)
Return
End Try

Try
oGsmModem.NewMessageIndication = True
Catch ex As Exception

End Try

btnSendvCard.Enabled = True
btnSendvCalendar.Enabled = True
btnSendWapPush.Enabled = True
btnDisconnect.Enabled = True

MsgBox(“Connected to phone successfully !”, MsgBoxStyle.Information)

End Sub

Private Sub btnDisconnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisconnect.Click
Try
oGsmModem.Disconnect()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try

btnSendvCard.Enabled = False
btnSendvCalendar.Enabled = False
btnSendWapPush.Enabled = False
btnDisconnect.Enabled = False
btnConnect.Enabled = True

End Sub

Private Sub btnSendvCard_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendvCard.Click
If txtPhoneNumber.Text.Trim = String.Empty Then
MsgBox(“Phone number must not be empty”, MsgBoxStyle.Critical)
Return
End If

Dim v As New vCard
v.LastName = “Magic Source”
v.Emails = New vCard.vEmails()
v.Emails.Add(New vCard.vEmail(“magic_opensource@hotmail.com”))
v.Telephones = New vCard.vTelephones
v.Telephones.Add(New vCard.vTelephone(“0192292309″, vCard.vLocations.CELL, vCard.vPhoneTypes.VOICE, True))
txtMsg.Text = v.ToString
Try
Dim msgId As String = oGsmModem.SendSMS(txtPhoneNumber.Text, v.ToString)
MsgBox(“vCard sent. Message id is “ + msgId)
Catch ex As Exception
MsgBox(ex.Message & “. Make sure your SIM memory is not full.”, MsgBoxStyle.Critical)
End Try
End Sub

Private Sub btnSendvCalendar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendvCalendar.Click
If txtPhoneNumber.Text.Trim = String.Empty Then
MsgBox(“Phone number must not be empty”, MsgBoxStyle.Critical)
Return
End If

Dim v As New vCalendar
Dim vE As New vCalendar.vEvent
vE.DTStart = New Date
vE.DTEnd = New Date
vE.Organizer = “Test Org”
vE.Summary = “Test Summary”
v.Events.Add(vE)
txtMsg.Text = v.ToString
Try
Dim msgId As String = oGsmModem.SendSMS(txtPhoneNumber.Text, v.ToString)
MsgBox(“vCalendar sent. Message id is “ + msgId)
Catch ex As Exception
MsgBox(ex.Message & “. Make sure your SIM memory is not full.”, MsgBoxStyle.Critical)
End Try
End Sub

Private Sub btnSendWapPush_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendWapPush.Click
If txtPhoneNumber.Text.Trim = String.Empty Then
MsgBox(“Phone number must not be empty”, MsgBoxStyle.Critical)
Return
End If
Dim href As String = “http://atopensource.110mb.com”
Dim text As String = “Share your mobile today”
Dim body As String = New WapPushMessage(href, text).ToString
oGsmModem.Encoding = ATSMS.Common.EnumEncoding.Hex_Message
Try
Dim msgId As String = oGsmModem.SendSMS(txtPhoneNumber.Text, body)
MsgBox(“Message sent. Message id is “ + msgId)
Catch ex As Exception
MsgBox(ex.Message & “. Make sure your SIM memory is not full.”, MsgBoxStyle.Critical)
End Try
End Sub
End Class


Trackback URL


RSS Feed for This Post27 Comment(s)

  1. Prashant | Oct 30, 2007 | Reply

    Is it possible to get list of Contacts, if yes how to implement that?

  2. Shawn Glenn | Apr 21, 2008 | Reply

    peribulbar outscream sussultorial hexasepalous thumping blurredness palaestrics strychninism
    Pleasant View Bed & Breakfast
    http://digsix.com/

  3. Pwhndvve | Aug 9, 2008 | Reply

    Rimsky went look closer buy cytotec then announced estivities.

  4. shrirams1 | Oct 13, 2008 | Reply

    Hi
    I wanna help to find out bluetooth device using dotnet technoly..
    Can any one help me

  5. magnus | Apr 14, 2009 | Reply

    Hi!
    I’m using an SMS Gateway to send texts, posting to a web service through http. If I post a vcal message, it is still sent as a normal text and the phone reads it as normal text. Do you have any idea how I can make it send a vcal and not just a normal text message?

  6. Glossicblinna | May 27, 2009 | Reply

    My friend just tell me and I can’t believe it, Mike’s daughter are dead so tragedy and so sad. I am a big fan of him, he is a great guy, best boxer – crazy little bet but every body know him and like him.

  7. 1 | Jun 2, 2009 | Reply

    Try appending an UDH to your message. vCard UDH Header usually is 06050423F40000

  8. ApepAfteltmiZ | Jul 6, 2009 | Reply

    It is a lot of talking about M. Jacksondead, it’s a very sad for me because I love his muai, I still didn’t believe in hs dead. Hi waas a definitely king of ‘Pop’.

  9. Esteban | Oct 15, 2009 | Reply

    Hi. I tried to use this code with Nokia 5200 and Samsung X-426 but the code don´t work.

    I need help please !

    I use PortMon to view COM communications.
    Results with Samsung X-426:
    Send commands but the modem not respond. If I connect with Hyperterminal, the modem repospond normally.

    Results with Nokia 5200:
    Every commands returns ERROR

    Thanks.

  10. Anna | May 4, 2010 | Reply

    That is a great idea!

  11. ajith murali | Aug 10, 2010 | Reply

    Dear Sir / Madam

    Plz help me to find a general format which can be used to send vcard sms to any mobile.
    I need inner code,since I am trying to built a program to send vcard sms,but I am not able to find approriate code.

    Will u help me plzzzzz

    Ur’s truely,
    Ajith murali

  12. Grercedek | Sep 22, 2010 | Reply

    Smokeless Cigarettes also be sure as electrifying cigarette and smokeless cigarette does not seat sundry risky chemicals that are found. Electronic cigarette smokers like the scheme of smoking. The motivation may be inspired by the propriety of the nicotine or the true act of having an.

  13. Exticecrextuh | Oct 13, 2010 | Reply

    Hiya all, long time browser first time poster here

    delighted to be a member, and I am looking forward to begin getting more active here

    In the mean time look at my site http://getpaidtowrite.faviblog.com/?p=6

  14. wedawoopend | Jan 30, 2011 | Reply

    Washing too often DOES remove much needed nutrients and natural oils. It’s best to wash hair every 2-4 days, depending on your.
    This weekend I went for it and decided to do the henna & indigo for a black coloring. Today is day 3 and my hair never looked so beautiful. I’m really impressed and very happy with Harvest Moon product. Before using the henna, my hair was thinning on the sides and it was very noticeable and embarrassing. I had a dandruff problem out of this world that I could not get rid of. Now my hair looks fuller, healthier, and my scalp feels great. Now my daughter wants me to due her hair and I would definitely recommend Henna Hut as an excellent quality of henna for naturally dying your hair. Thank you.
    Blended Beauty curly hair care products have been designed to moisturize, tame and define the full range of naturally curly, biracial and afro hair types. Whether you have waves, corkscrew or kinky curls, locs or relaxed hair, we have natural hair products for you.
    A successful hair transplant can change your life. Hasson & Wong leads the way in providing natural, consistently amazing results. We change lives every day, providing world-class hair transplants using proven, leading techniques. Best of all, our results are guaranteed!
    My confidence is restored and I feel that my life has greatly improved due to this. I’m always looking forward to family gatherings and going out with my friends to have a great time. I’m always looking for things to do and have fun!
    Over the years, Hair Reflections has become a thriving, internationally-known salon. Glamour Magazine has listed Hair Reflections in the top 25 salons in the world.
    laroyce lathair smith v. texas
    Calcium in water binds with dirt and dead skin cells on the scalp to create an insoluble mass which blocks the hair follicle, making hair dull and weak. Shampooing alone does not remove this residue.
    Laser Hair Removal, when first introduced in the late 1990’s, was limited to light skinned individuals with dark hair. Efficient Laser Hair Removal was produced by Alexandrite and Diode lasers. Dark skinned individuals could not use these lasers for effective hair removal because early generation lasers were unable to distinguish between skin pigment and hair follicles, which led to the burning of those with darker skin. Today this has all changed. The advent of the new laser line, the YAG, and the re-invention of the IPL system has afforded excellent results for individuals with dark skin and dark hair.
    © Copyright 2006-2010 ChaCha Search, Inc. – Experimental Use, All Rights Reserved, Covered by US or Foreign Patents or Patents Pending. Copyright Notice | Terms of Use | Privacy
    The Me style costs $1200L for a fatpack, $250L for the essentials pack, $220L per 5-color natural & 10-color rainbow packs and the demos are free.  Please be patient if the sim is crowded because of the scripted delivery system.
    larry hillblom foundation

  15. http://wiki.bander.me/index.php?title=User_talk:Yzan1131 | Jan 31, 2012 | Reply

    Actually instructive and superb structure of articles, now that’s user friendly (:.

  16. commission airwave | Apr 13, 2012 | Reply

    I have to just say what a comfort to have found someone who really understands what they are discussing over the internet. You actually understand how to bring an idea to sight and make it understandable.

  17. Vafstart | Apr 18, 2012 | Reply

    Although all associates of ones own see each other everyday, relationship is necessary. This is certainly fundamentally the ultimate way to improve the call among the list of family members and also create your relationship to one another better. It really is fantastic to do something outside the house but in case the climate is not that good or maybe it can be raining outdoors, you can look at different kinds of indoor game titles and exercises which could seriously make everyone feel happy. This is an excellent substitute you could think about. Below are some of the video game titles and the routines that you can do inside your home.Hide and seek has become the most widely used games actually experienced and this will surely be made inside your home. An individual really needs to be an Half inchitHalf inch who will be responsible of searching for other loved ones who’re hiding. Reduce costs which is to be uncovered with out touching/reaching your home platform will then function as next “it.Inches But if you are believe it’s not an amazing choice, you possibly can look into charade which happens to be an additional indoors activity. On this recreation, preferably, there should be two teams. It will have part which will act up the term that is authored on a piece of paper as the fellow members are usually in-handle of questioning the word. The group with more things will be reported as the victor.Besides hide and go seek and charade, quite a number of card and board games are among the great possibilities that you could investigate. Cards include things like Menagerie, Ancient Cleaning service, Rolling, Jewel, Slapjack and many other. For games, you can choose Scrabble, Mentally stimulating games, Monopoly, Relatives Feud and Pieces. When you have plenty of choices to see, you just need to decide on the brains behind you imagine is very fun.However, if you feel playing the games that had been mentioned previously will not be adequate, it is possible to go with other activities which almost all of the close relatives have interests in. As an example, if you value to prepare/bake to be able your family, you may makes exercise in an effort to bond with the fam. You are able to give each fellow member to try and do a particular section of the bakingAndbaking approach so that everybody will love. Ensure that every person grows to participate in these hobby. And once food is made or maybe the dessert is prepared, then you can eat it with each other with the relatives. Everybody will definitely be thrilled to eat the berry in their labor. As well as preparing foodAndpreparing your receipee, you can also take into account several other pursuits like artwork, belly dancing, music and singing, looking through, looking at movies and a lot of much more.Mentioned quite solutions for bond with the fam nevertheless these are very helpful. There is no need for you personally spend big money since these basic issues can definitely take joy to absolutely everyone especially if the family members are finish. It isn’t really really crucial that these materials should be done every day. Once every seven days or simply a rare occasions monthly will work.

  18. yeududexb | Apr 19, 2012 | Reply

    Hi,

    Equipped with T-Dubb’s information My partner and i organized our tactic? and executed this. To produce a long story small while he came back to get his or her items he was around the patio steps pleading me personally to take into consideration him or her back. The information on this book is quite Effective and will be utilized with warning as well as taken care of being a crammed system

    Hope I posted this in the right section but if you are looking for relationship advice please look my page! Go Here

  19. Vafstart | Apr 20, 2012 | Reply

    Although all associates of your family see each other each day, connecting remains to be essential. This can be in essence the simplest way to reinforce the hyperlink among the list of relatives and in some cases create your partnership to one another healthier. Really it is fantastic to behave outside the house but should the temperature is not that very good or if it’s seeing external, you can consider different kinds of indoor activities and pursuits that will actually make every person feel happy. This is an excellent alternative that you can factor in. The following are some of the games or things to do you can apply inside.Hide and go seek is just about the most in-demand video game titles at any time performed which really can be exercised inside your home. An individual must be an “itHalf inch that happen to be responsible of searching for other family members who definitely are covering. Reduce costs that might be identified without having coming in contact withPerhitting your home bottom might be the next Half inchit.Inches But in case you are think that this is not an amazing selection, you possibly can take a look at charade which is a further household sport. With this video game, ideally, there ought to be two groups. There’ll be part that will act out the term that is definitely composed on certificates whilst the fellow members are working-charge of guessing the term. They with the most details will be stated because the success.As well as hide and go seek and charade, quite a number of credit card and board games are also one of many perfect decisions you could take a look at. Cards consist of Menagerie, Old Cleaning service, Moving, Rock, Slapjack and others. For board games, you possibly can opt for Scrabble, Chess, Monopoly, Family Feud and Checkers. When you have a lot of options to see, you simply need to pick the one which you believe really is exciting.In contrast, if you feel taking part in the online games that were already stated will never be up to scratch, you possibly can opt for other pursuits which the majority of the family members have hobbies in. In particular, if you love to cookPercook so as your family, you’ll be able to choose this activity so that you can connect with the fam. You’ll be able to designate each fellow member to accomplish some section of the preparing your receipeePerpreparing process so that everybody will love. Make sure that everyone grows to take part in like action. As soon as foodis cooked or even the food is baked, then you can eat it in concert considering the loved ones. Anyone will really be thrilled to eat the fresh fruits of the crews. Apart from food preparationOrbaking, also you can take into consideration various other pursuits like artwork, bouncing, vocal, studying, observing motion pictures and lots of more.I have listed very approaches to rapport with your family however, these can be extremely useful. There is no need for you shell out a lot of money because these straightforward items can certainly get delight to everyone specifically if the family members are comprehensive. It isn’t really actually necessary that these items should be carried out on a daily basis. Once per week or possibly a few times every month will do.

  20. Coleen Delbene | May 31, 2012 | Reply

    I’ve recently started a web site, the information you offer on this website has helped me tremendously. Thanks for all of your time & work. “It is no use saying, ‘We are doing our best.’ You have got to succeed in doing what is necessary.” by Sir Winston Churchill.

  21. dimazmej | Jun 11, 2012 | Reply

    Виртуализация на базе Citrix Xenserver
    Citrix Anal sex
    Часто бывает так, что нам необходимо виртуализировать те или иные програмные продукты. В своей небольшой статье, я раскажу как я это делал на базе Citrix Xenserver 5.6.

  22. buy shelves | Jun 28, 2012 | Reply

    I think this is one of the most vital information for me. And i am glad reading your article. But want to remark on few general things, The site style is perfect, the articles is really nice : D. Good job, cheers

  23. ditofluentili | Aug 3, 2012 | Reply

    Can it be gonna be plainly for offering in the meat, or will the small business involve making dairy goods together with other by-product items from cattle. rzfillergibberillickw xxqzxwyxne Slowly and gradually, the affirmation turns into ones’s personal plus the frame of mind undergoes a transform.

  24. milf town | Jul 15, 2013 | Reply

    Hey just wanted to give you a quick heads up. The words in your article seem to be running off the screen in Internet explorer.
    I’m not sure if this is a format issue or something to do with web browser compatibility but I figured I’d post to let you know.
    The design look great though! Hope you get the problem solved soon.
    Thanks

  25. blog.com | Feb 10, 2014 | Reply

    Possibly, this is not the happiest story but mold remediation we are sharing it because it is harmful to kids and
    pets.

  26. tax news | Sep 20, 2014 | Reply

    Every weekend i used to visit this site, as i want enjoyment, as this this
    web site conations in fact fastidious funny data too.

  27. chewables nutri vet | Oct 23, 2014 | Reply

    If some one desires to be updated with most
    up-to-date technologies after that he must be pay a quick visit
    this web page and be up to date everyday.

RSS Feed for This PostPost a Comment

*