So I am working on an inventory program ( personal use ) that when certain elements reach a specified value I would like a text message with the value and item nomenclature sent to my phone and my girlfriends phone. Is there a way to do this? I know email is possible, but I want a text message instead.
As I noted in the title, I am using Linux as my platform ( MS sucks ( been 100% Linux since 1999 ) and Mac is out of my pocketbook range )
If you want âsomeâ kind of instant text message and not only SMS, you could try telegram, you can use itâs API to send messages with only a call to an URL, even with curl from shell if you want.
Disclaimer: I donât use the below. For messaging I use a google account and send emails direct.
I think there is a low cost associated with almost all services that send actual SMS (like Twillio) - I think cost is around $0.004 - $0.04 per SMS (depending on locale/service).
Alternatively you could use a chat service to message. This might be of help:
When inventory hits a preset value, my girlfriend and I are notified of the item(s) via text. Which works when one of us is in town. Then whichever one of us is in town can then purchase the item(s) before we head home. We live off-grid and going to town is time consuming, so the idea is to set this up so we can get stuff while we are out.
' set up the socket--Socket1 is an SMTPSocket
Socket1.Address = "smtp.gmail.com"
Socket1.Port = 25
If AuthenticateBox.Text = True Then
Socket1.UserName = "***"
Socket1.Password = "*****"
Else
Socket1.UserName = ""
End If
Var mail As New EmailMessage
mail.FromAddress = "****@gmail.com"
mail.Subject = "Test"
mail.BodyPlainText = "If this works..."
'mail.BodyHTML = HtmlField.Text
mail.Headers.AddHeader("X-Mailer","Example SMTP Demo")
' add recipients
Var CR As String = EndOfLine.CR
Var LF As String = EndOfLine.LF
Var s As String
s = "9999999999@vtext.com".ReplaceAll(",", CR)
s = s.ReplaceAll(EndOfLine.CRLF, CR)
Var recipients() As String
recipients = s.ToArray(CR)
For Each recipient As String In recipients
mail.AddRecipient(recipient.Trim)
Next
'' add cc recipients
's = CCAddress.Text.ReplaceAll(",", CR)
's = s.ReplaceAll(EndOfLine.CRLF, CR)
'recipients.RemoveAllRows
'recipients = s.ToArray(CR)
'
'For Each recipient As String In recipients
'mail.AddCCRecipient(recipient.Trim)
'Next
'Var file As EmailAttachment
'
'' add attachments
'If Not fileField.Text.IsEmpty Then
'file = New EmailAttachment
'file.LoadFromFile(New FolderItem(fileField.Text, FolderItem.PathModes.Native))
'mail.Attachments.Add(file)
'End If
' send the email
Socket1.Messages.Add(mail)
Socket1.SendMail
And I get a whole slew of errors. The code is from the help pages. I have tried a few different ways to change it but⊠I have never done this before so I am kind of flying blind. Anyhow in a button I have this code
If Me.Caption = "Connect" Then
ServerSocket1.Address = "smtp.gmail.com"
ServerSocket1.Port = 110
ServerSocket1.UserName = "***"
ServerSocket1.Password = "***"
ServerSocket1.Connect
Me.Caption = "Disconnect"
Else
ServerSocket1.DisconnectFromServer
Me.Caption = "Connect"
End If
And a whole litany of errors there⊠what am I missing or doing wrong? This is the source of the code listed here â EmailMessage â Xojo documentation
Once I understand what I am doing wrong⊠look out!
I am trying to find the documentation for sending text messages. All I seem to find is email. So I figure might as well learn that too. But I still havenât figured out how to send a text message. Since Linux has native SMS capabilities I am hoping to use that.
Since we may need to do this in one of our programs, we have been looking at different options. I just wanted to alert Xojo devs that AT&T will be shutting down their gateway on June 17th. Per google:
" AT&T is discontinuing its email-to-text and text-to-email service on June 17, 2025. This means that users will no longer be able to send or receive text messages via email using the AT&T network. The email addresses used for this service, such as those ending in @txt.att.net or @mms.att.net, will no longer be functional."
If youâre wanting to send email rather than SMS that is very doable and works fine with Google.
My use case was to provide a ânoreplyâ email with a 1-time password for users to reset theirs, but would work for notifications.
I did this for a web app using Sending email from your app â Xojo documentation
I created a dedicated gmail account for the purpose - IIRC you need to set up 2FA and create app-specific password for this to enable SMTP, which was the main obstacle (google has helpful instructions on how to enable this).