הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
Question
Wednesday, January 23, 2013 1:42 PM
Does anyone have experience with developing code to send SMS text messages to a cell phone?
Could you please share your experiences?
Are there 3rd party DLLs or active X available that could be purchased?
Thank you
LEONARD ANSIN
All replies (15)
Wednesday, January 23, 2013 2:48 PM ✅Answered | 1 vote
The SMTP code is different depending on your email server (POP3 account). There are three different port numbers that are used (depending on the encryption method). Check your email server website for sample connection code for SMTP. Besides the the port number (and security) there are three different modes for SMTP
1) Use a outlook server on the local PC
2) Use a remote outlook server
3) Use a POP3 server.
An SMS message will look identical to any other email message send using SMTP. the only differrence is the destination address which will be an email address associated with the phone.
jdweng
Saturday, January 26, 2013 5:21 PM ✅Answered | 1 vote
Hi Jim:
I downloaded the program. Looks very nice, but had some trouble getting it to send.
Could you please send me the source code?
Thank you
LEONARD ANSIN
what was the error? some documentation http://www.jimbrown.ws/Text'em.pdf
sample code of minimal send mail
Private Sub TextMessage(ByVal sender As System.Object, ByVal e As System.EventArgs)
Try
Dim SmtpServer As New SmtpClient()
SmtpServer.Credentials = New Net.NetworkCredential("username@email.com", "password")
SmtpServer.Port = 25
SmtpServer.Host = "smtp.server.com"
SmtpServer.EnableSsl = False
Using mail As New MailMessage()
mail.From = New MailAddress("from@yourserver.com")
mail.To.Add("8005550100@txt.att.net")
mail.Subject = "SMS Text Message"
mail.Body = "Text Message Here ..."
SmtpServer.Send(mail)
MsgBox("Text Message sent successfully!")
End Using
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
SMS Gateways: http://en.wikipedia.org/wiki/List_of_SMS_gateways
Hope this helps
Sunday, January 27, 2013 7:05 PM ✅Answered
There is also a google voice sdk you can use to send sms messages.
http://code.google.com/p/sharp-voice/
Wednesday, January 23, 2013 2:35 PM | 1 vote
The normal method is to send an email to the user phone like 1234567@verizon.com. You can use your own email server as the From address using an SMTP Client Class and don't need a third party dll.
jdweng
Wednesday, January 23, 2013 2:41 PM
Thank you for your quick reply.
Do you have some sample code?
that would be very helpful.
Best Regards
LEONARD ANSIN
Thursday, January 24, 2013 9:05 PM | 1 vote
Leonard, here is an application I wrote in vb.net to send SMS text message: http://www.jimbrown.ws/dltextem.aspx
Thursday, January 24, 2013 10:59 PM
Hi Jim:
I downloaded the program. Looks very nice, but had some trouble getting it to send.
Could you please send me the source code?
Thank you
LEONARD ANSIN
Saturday, January 26, 2013 5:45 PM
What port number is the programming using and what level of security? Different mail servers use either port 25/587 (no encryption), 465 (SSL), 587 (TLS), 110 (POP), 995(POP SSL). And these are just the common options.
jdweng
Sunday, January 27, 2013 4:14 PM | 1 vote
My app http://www.jimbrown.ws/dltextem.aspx has a gui settings form and the end user must provide smtp server information. that is more than likly LEONARD error not using a valid smtp server.
Sunday, January 27, 2013 4:36 PM | 1 vote
My app has a gui settings form and the end user must provide smtp server information. that is more than likly LEONARD error not using a valid smtp server.
Hello Jim,
Please be advised it is more helpful to provide the source code to your example(as this forum is for receiving aid in Visual Basic development)
I recommend replacing all of the links that you have provided to any compiled projects/exe's(as it is suspicious by default), with new links to zipped, un-compiled example projects(source view-able).
Thanks
“If you want something you've never had, you need to do something you've never done.”
Don't forget to mark helpful posts and answers ! Answer an interesting question? Write a new article about it! My Articles |
*This post does not reflect the opinion of Microsoft, or its employees.
Sunday, January 27, 2013 5:50 PM
Does your code provide options for both TLS and SSL. some mail server require security. As I said in my first response that Lenorard needed to check hius mail server to see what settings are needed for SMTP.
jdweng
Sunday, January 27, 2013 7:12 PM
My app has a gui settings form and the end user must provide smtp server information. that is more than likly LEONARD error not using a valid smtp server.
Hello Jim,
Please be advised it is more helpful to provide the source code to your example(as this forum is for receiving aid in Visual Basic development)
I recommend replacing all of the links that you have provided to any compiled projects/exe's(as it is suspicious by default), with new links to zipped, un-compiled example projects(source view-able).
Thanks
“If you want something you've never had, you need to do something you've never done.”
Don't forget to mark helpful posts and answers ! Answer an interesting question? Write a new article about it! My Articles
*This post does not reflect the opinion of Microsoft, or its employees.
I did provide example code: just simplified
Private Sub TextMessage(ByVal sender As System.Object, ByVal e As System.EventArgs)
Try
Dim SmtpServer As New SmtpClient()
SmtpServer.Credentials = New Net.NetworkCredential("username@email.com", "password")
SmtpServer.Port = 25
SmtpServer.Host = "smtp.server.com"
SmtpServer.EnableSsl = False
Using mail As New MailMessage()
mail.From = New MailAddress("from@yourserver.com")
mail.To.Add("8005550100@txt.att.net")
mail.Subject = "SMS Text Message"
mail.Body = "Text Message Here ..."
SmtpServer.Send(mail)
MsgBox("Text Message sent successfully!")
End Using
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Monday, January 28, 2013 10:21 AM
The FROM mail address and the credentials have to be from the same mail account.
jdweng
Wednesday, January 30, 2013 12:21 PM
Hi everyone:
Thank you so much for your help. You are all terrific.
Question: Is there a method to track the message once it leaves the application? For example, if the port number is wrong, can I trap the error and alert the sender?
Thank you
LEONARD ANSIN
Wednesday, January 30, 2013 1:34 PM
The Catch Exception handler will capture the errors, but not tell you specifically that the port number is wrong. The port number should normally be either 25, 465, 587 so you can add code to warn users if another port number is entered. With SMTP, you can send a test message (with no body) to validate the source and destination email accounts. I can locate the source ocde for these test messages if you can't find it on the web.
jdweng