|
I am developing a windows application in VB.Net 2005.
In this I want to send mail to my gmail id.
And also if I receive mail on my gmail account then it should be displayed in my application.
Firstly tell me how to send mail to any e-mail ID through my windows application.
In short I want functionality of Outlook Express in my application means in Outlook Express we can configure our gmail or yahoo account in similar way I want to configure my gmail account into my windows application.
Please tell me how to do this?
|
|
|
|
|
study system.web.mail library deeply. it is simple to send mails
Salman Sheikh
|
|
|
|
|
I think this link[^] has an answer for you.
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
hey Steven,
i tried the code given by you as follows -
Dim myMessage As New System.Net.Mail.MailMessage()
With myMessage
.To.Add("harshal_shravgi@gmail.com")
.From = New System.Net.Mail.MailAddress("harshal_shravgi@yahoo.com", "Harshal")
.Subject = "Test For Sending Mail"
'.Attachments.Add(New System.Net.Mail.Attachment("path of attachment here"))
.Body = "Hi hello How are U?"
.IsBodyHtml = False
End With
Dim SmtpMail As New System.Net.Mail.SmtpClient
With SmtpMail
.Host = "smtp.gmail.com"
.DeliveryMethod = SmtpDeliveryMethod.Network
'Credentials only required if your SMTP server requires User Name and Password
.Credentials = New System.Net.NetworkCredential("harshal@veda-logic.com", "board8414")
.Send(myMessage)
End With
But got error as -
The SMTP server requires a secure connection or the client was not authenticated. The server response was:
5.7.0 Must issue a STARTTLS command first m34sm543278waf
|
|
|
|
|
I did it using my gmail account as follows -
Dim myMessage As New System.Net.Mail.MailMessage()
With myMessage
.To.Add("harshal_shravgi@rediffmail.com")
.CC.Add("ashish@veda-logic.com")
.From = New System.Net.Mail.MailAddress("harshal.shravgi@gmail.com", "Harshal")
.Subject = "Test at " & Now
.Attachments.Add(New System.Net.Mail.Attachment("C:\Documents and Settings\x\Desktop\code.txt"))
.Body = "Hi hello How are U?"
.IsBodyHtml = False
End With
Dim SmtpMail As New System.Net.Mail.SmtpClient
With SmtpMail
.Host = "smtp.gmail.com"
.DeliveryMethod = SmtpDeliveryMethod.Network
.Credentials = New System.Net.NetworkCredential("harshal.shravgi@gmail.com", "pochhi")
.EnableSsl = True
.Timeout = 10
.Port = 25
.Send(myMessage)
End With
MessageBox.Show("Message Sent")
Now tell me how to receive mails same as we do it in Outlook Express
|
|
|
|
|
Asalam-O-Alikum!
what is the easiest way to insert data from one DataBase table to an other database table with same structure or same schema.
Reagards.
B asharatA li
Internee
METESYS Lahore
Pakistan
|
|
|
|
|
find info about DTS (Data Transformation Service) about the DBMS you are using. It is not difficult
Salman Sheikh
|
|
|
|
|
Thx for ur time
but i want to do this throug vb code at run time when user press a button.
Regards
B asharatA li
Internee
METESYS Lahore
Pakistan
|
|
|
|
|
I need to run a DOS process application and get the final ErrorLevel.
Three questions:
a) How can i execute from Vb.net
a) How can i get the final ErrorLevel.
b) Is possible to redirect output stream data process to a form on my applicacion.
regards
|
|
|
|
|
Hi,
have a look at the Process class.
You will be interested in the Start() method, the ExitCode property, and others as well.
And there are plenty of examples here on CodeProject.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
hai,
I have tried to use 3 layers
Presentation Layer,business Logic Layer, Data Access Layer
Just i Have tried,tell whether this is correct or not?
In My Presentation Layer[tUserPL.aspx]
i have two textbox one for UserName and other for password
<code>
Dim i As String
Dim UserBLL As New UserBLL
Private Sub btnSubmit_ServerClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.ServerClick
Try
UserBLL.User_Name = Me.txtuser.Value
UserBLL.User_Pass = Me.txtPass.Value
i = UserBLL.Verify()
If i > 1 Then
Response.Redirect("\IPB\tBillCorrectionA.aspx")
Else
Response.Write("Not an Authorized User")
End If
Catch ex As Exception
Response.Write(ex.Message.ToString())
End Try
End Sub
</code>
In My business Logic Layer[UserBLL.aspx] i Have the Following,
<code>
Public Class UserBLL
Public err, cmd_value, qry_value As String
Dim UserData As New UserDAL
Dim sqlconn As New SqlClient.SqlConnection
Public Property User_Name() As String
Get
Return cmd_value
End Get
Set(ByVal Value As String)
cmd_value = Value
End Set
End Property
Public Property User_Pass() As String
Get
Return qry_value
End Get
Set(ByVal Value As String)
qry_value = Value
End Set
End Property
Public Function Verify()
Dim sqlcmd As SqlClient.SqlCommand
Dim i As Integer
Me.sqlconn.ConnectionString = ConfigurationSettings.AppSettings("BB_CONSTR")
Me.sqlconn.Open()
Return UserData.ExecuteMsgQuery("select count(*) from mast_users where cLogin like '" & User_Name & "' and cPassword like '" & User_Pass & "'", sqlconn)
End Function
End Class
</code>
In My Data Access Layer[UserDAL.aspx] i Have following
<code>
Public Class UserDAL
Public Shared Function ExecuteMsgQuery(ByVal selQuery As String, ByVal myCon As SqlClient.SqlConnection) As Int16
Try
Dim SqlAdpt As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(selQuery, myCon)
If SqlAdpt.SelectCommand.ExecuteScalar > 0 Then
Return 2
Else
Return 1
End If
Catch ex As Exception
Return 3
Finally
End Try
End Function
</code>
In above i have tried to get a concept but i think i am not in correct way and
i need a result like verfying the user name and password and return back to BLL
i am not getting any error and i am redirecting to another page after verifying user name and password. after i am getting correct as result i need to proceed the same concept in my project. help me out...
sathimailin
|
|
|
|
|
hi , i have a Written a nice for Beginners.
http://www.codeproject.com/useritems/N-Tier_Application.asp[^]
Hope it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
for ex,
there are 2 datetimepicker,1 textbox,1 button named as firstdatetimepicker,seconddatetimepicker,noofdaystextbox and okbutton.
calculation is
seconddatetimepicker = firstdatetimepicker + noofdaystextbox.
example-1
if i give date to firstdatetimepicker is "22-10-2007" and i give no of days to noofdaystextbox is 4,then i click ok button means,must add 4 days from "22-10-2007",in seconddatetimepicker must automatically displayed as "26-10-2007"
example-2
if i give date to firstdatetimepicker is "15-10-2007" and i give no of days to noofdaystextbox is 9,then i click ok button means,in seconddatetimepicker must automatically displayed as "24-10-2007"
i do my project in .net 2005 windows application.i want in .net windows application.
|
|
|
|
|
It's very simple. Convert the string in the textbox to a number (for example using Int32.TryParse), then use the AddDays method on the date to create a new date with the days added.
---
single minded; short sighted; long gone;
|
|
|
|
|
datetimepicker.value is a property which returns or accepts date object
you can add days in a date using Date.Add method which will return another date with added number of days.
Salman Sheikh
|
|
|
|
|
how to save a windows application project in vb.net will be save as an .exe file as in vb6
|
|
|
|
|
in .NET you Deploy your Program in , and convert it into something we call" Msil", that will be your Exe. that Msil run on a .NET Platform, this means you have to install .NET framework where ever you run a Msil. So in your case now, Add a new Project and Add it to the Existing Project, choose Setup and Deployment Object and follow the Folling Guideline in on this site.
http://www.c-sharpcorner.com/UploadFile/vishnuprasad2005/SetupProjects12022005022406AM/SetupProjects.aspx[^]
Hope it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
It's done automatically every time you run your app from inside the IDE. Look in your project folder. You'll find a bin folder with two folders inside it, Debug and Release. You're .EXE will be found in either of those folders.
The Debug version has all kinds of debug code compiled into it. You normally don't deploy this version to the customer. You normally deploy the Release version.
|
|
|
|
|
How can I track the keypress of Tab Key in a DataGridView. The column in which I want to track is of a textbox type column.
Your suggestions will help me a lot.
CSS.
Sekhar
|
|
|
|
|
What do you mean by "tracking a TextBox column"?? What do you want to do when the user hits the Tab key??
|
|
|
|
|
use keydown or keyup event and check
e.keydata = keys.tab
Salman Sheikh
|
|
|
|
|
I have a TabControl and several pages to it. Each of the pages contains one datagridview and few buttons. I want when i press the tab key on the last cell of the last row of a datagridview, it should take me to the next page of the Tabcontrol and place the focus on the first cell of the datagridview of that page. So for this I need to track the keypress for the cell from which i want to shift the focus to the next page's datagridview. And the last column of the datagridview is a textBox type column.
Sekhar
|
|
|
|
|
In that case, you handle the KeyDown event of the DGV and check the event args KeyCode property for the Keys.Tab key. If pressed, you have to check to see what the cuurnet cell is. If the current cell is the last one, you set the Handled propery of the event args to True and make your changes to the TabControl. Otherise, you do nothing.
|
|
|
|
|
I'm having a problem getting a textbox to display some data. The application is recording sound and I wanted to see a few pieces of data as it comes in. I set the text property from within a thread and it doesn't do anything, not even display a zero.
I've checked as the obvious stuff; the textbox1.text code is being executed, and there isn't any other code relating to textboxes anywhere else that would overwrite it. Any help would be appreciated
|
|
|
|
|
I'm surprised it doesn't blow up. In VB2005, accessing a form control from a thread that didn't create it, should blow it up.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|