473,388 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

SMS Problem

hi i have one doubt i send sms to phone via email but i got system.net.mail.smtpclient.send(mailmessage message) why this erro came. my code
Expand|Select|Wrap|Line Numbers
  1.  
  2.    mTo = Trim(TextBox1.Text) & Trim(ComboBox1.SelectedItem.ToString())
  3.         mFrom = Trim(TextBox2.Text)
  4.         mSubject = Trim(TextBox4.Text)
  5.         mMailServer = Trim(TextBox3.Text)
  6.         mMsg = Trim(TextBox5.Text)
  7.  
  8.         Try
  9.             Dim message As New MailMessage(mFrom, mTo, mSubject, mMsg)
  10.             'Dim mySmtpClient As New SmtpClient(mMailServer)
  11.             'mySmtpClient.UseDefaultCredentials = True
  12.             'mySmtpClient.Send(message)
  13.  
  14.             Dim smtp As New SmtpClient()
  15.             smtp.Host = "smtp.gmail.com"
  16.             smtp.Credentials = New System.Net.NetworkCredential
  17.             smtp.EnableSsl = True
  18.  
  19.             smtp.Send(message)
  20.             'Dim basic Authentication Info As New System.Net.NetworkCredential(mMailServer)
  21.  
  22.  
  23.  
  24.             MessageBox.Show(" The mail message has been sent to " & message.To.ToString(), "Mail", MessageBoxButtons.OK, MessageBoxIcon.Information)
  25.  
  26.         Catch ex As FormatException
  27.             MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error)
  28.         Catch ex As SmtpException
  29.  
  30.             MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error)
  31.         Catch ex As Exception
  32.  
  33.             MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error)
  34.         End Try
  35.  
Feb 11 '08 #1
1 952
Plater
7,872 Expert 4TB
You never said what error your are getting.

As for gmail, did you make sure to turn on SMTP from your gmail account webpage?
Feb 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

117
by: Peter Olcott | last post by:
www.halting-problem.com
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.