Example Code

Sending SMS (text messages) using SMTP with LabVIEW

Code and Documents

Attachment

Many times it can be convenient to have LabVIEW send a text message. Unfortunately, LabVIEW is not a cell phone, however, it can use free services (*text messaging fees may apply) provided by phone service providers to send an email which is then transformed into a text message. In the example below, the "Send SMS example.vi" calls  the "Send SMS.vi" to send a text message using SMTP (Simple Mail Transfer Protocol). Note that in the example the smtp server that is used is GMail's; you will need a gmail account to send the email. It is possible to change the SMTP server by simply modifying the appropriate control.

Send SMS.png

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
JohnCaipa
Member
Member
on

Excelent example!

D*
Member
Member
on

I like it.  It was easy to fix, but the 2009 example needs to link to the 2009.vi and not the 2012.vi.

Dominik-E2
Member
Member
on

You are correct. I've re-linked the VI and uploaded the fixed version. Thanks!

nad21
Member
Member
on

Hi the 2009 version i cant open as it says its a 2011 version.

Dominik-E2
Member
Member
on

Should be fixed now. Thanks for letting us know.

enriqueesc
Member
Member
on

sorry I'm in Mexico and I want to send the message to the company which would be the gateway Telcel for Telcel send I would appreciate the help thanks

vip90
Member
Member
on

i am in india there is such service provider as in send sms 2012.vi

if i using tata docomo or aircel or airtel

then what addresh i use,

please help me

Lasnier
Member
Member
on

Still cannot open the 2009 version in LABView 2009. It is calling for version 11.

salidobitbetter
NI Employee (retired)
on

Alright, try again. I've reloaded a new zip for 2009 and checked the versioning and it should be 2009 now.

Application Engineering Specialist
National Instruments
Lasnier
Member
Member
on

Thanks- works great!

wilsoa7
Member
Member
on

Is there a version of this for Labview 8.2?  I downloaded both versions and they work great! but unfortunately my lab has an ancient computer that is running only Labview 8.2.  This would be a great feature to include. 

wilsoa7
Member
Member
on

Nevermind, I found where you can save the vi in an older version, and now it's working great!  thanks a lot for the example!

bossyufighting1
Member
Member
on

how to use this in singapore????

simo95
Member
Member
on

i'm from italy and i have a server problem: how can i do to use this example in italy?

Lasnier
Member
Member
on

It doesn't matter where the LabVIEW is, it matters which phone company serves the phone you are sending to. Various phone companies have email-to-SMS services for their own phones, and this email address (if it exists) is the information you need.

ghus
Member
Member
on

como puedo mandar de servidor telcel??

acromer
Member
Member
on

Works Great! Thanks!

tbz709
Member
Member
on

Is there a 2014 version of this? Getting a weird error...

Invoke Node System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

          Inner Exception: System.ArgumentNullException: Value cannot be null.

Parameter name: message <append><b>System.ArgumentNullException</b> in ECGTT.vi

Dominik-E2
Member
Member
on

Google has implemented a new security feature that disables logins to their GMail server with "less secure apps". This prevents this VI from being authenticated properly. However, this feature can be disabled. I would recommend making a dummy account so you do no compromise your real gmail account. I just verified that enabling less secure app access resolves this issue.

https://www.google.com/settings/security/lesssecureapps

tbz709
Member
Member
on

Thanks, very helpful information, but not quite right.
Created the dummy account and allowed for access.
Also tried changing the email username to include my full email and got this...

Error 1172 occurred at Invoke Node System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

          Inner Exception: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at

Possible reason(s):

LabVIEW:  A .NET exception occurred in an external assembly. For information about correcting this error, copy the following exception (in bold), and search the Microsoft Developer Network (MSDN) Web site or the Web for a possible explanation.

System.Net.Mail.SmtpException in ECGTT.vi

                    

http://forums.ni.com/t5/LabVIEW/Error-trying-to-send-SMS/m-p/3108496#M891023
This is my thread on the forum

TUDarmstadtLLX
Member
Member
on

Hello,

 

it is really a cool example. But I want to know, if I can do this with a phonenumber in Germany?

 

Best regard.

Danny_Hendrikx
Member
Member
on

Hello,

I need some help on this subject ?

 

I tried the vi and followed all tips and tricks. 

The example vi is working properly and tells me that "Sent was Successfully".

It was because i can see in my e-mail account that the messages are in the folder Send e-mails.

 

But i do not receive anything on my cell phone. 

The phone number was correct 😉

 

If i change the phone number xxxxxx@xxxxx.xx with a existing e-mail address it has the same effect.

The message from the VI appears under the email account folder SENT but was never received by the recipient email address.

When i "REPLY" the massage in the SENT folder it will go well. ==> So the e-mail address is oké.

 

 

Any idea's ?

 

Thanks in advance,

Danny

 

Contributors