Convert VB.NET codes to VB6? Anyone, please! T.T
Greetings! I'm new here & asking for your help guys...Thanks! :D
My codes from VB.NET is:
Code:
Dim mymailmsg As New MailMessage
Try
Dim response As MsgBoxResult = MsgBox("Do you want to continue sending?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Sending Confirmation")
If response = MsgBoxResult.Yes Then
loading.Value = 10
mymailmsg.From = New MailAddress("[email protected]")
loading.Value = 20
mymailmsg.To.Add("[email protected]")
loading.Value = 30
mymailmsg.Subject = txtSubject.Text
loading.Value = 40
mymailmsg.Body = document.Text
loading.Value = 50
Dim smtp As New SmtpClient("smtp.example.com")
loading.Value = 60
smtp.Port = 587
loading.Value = 70
smtp.EnableSsl = True
loading.Value = 80
smtp.Credentials = New System.Net.NetworkCredential("[email protected]", "informatics")
loading.Value = 90
smtp.Send(mymailmsg)
loading.Value = 100
MsgBox("You have sent your message!")
loading.Value = 0
Else
End If
Catch ex As Exception
End Try
Can someone convert my codes to vb6? Thanks!!! :)
Re: Convert VB.NET codes to VB6? Anyone, please! T.T
Thread moved from 'Chit Chat' forum to 'VB6 and Earlier' forum
Re: Convert VB.NET codes to VB6? Anyone, please! T.T
Here is th VB6 version. HOWEVER you could need to find a way of sending the emails through VB6 so I've commented out SMTP & mymailmsg.
Code:
Dim mymailmsg As New MailMessage
'Dim smtp As New SmtpClient("smtp.example.com")
Dim MsgBoxResult As Integer
MsgBoxResult = MsgBox("Do you want to continue sending?", vbQuestion + vbYesNo, "Sending Confirmation")
If MsgBoxResult = vbYes Then
loading.Value = 10
'mymailmsg.From = New MailAddress("[email protected]")
loading.Value = 20
'mymailmsg.To.Add ("[email protected]")
loading.Value = 30
'mymailmsg.Subject = txtSubject.Text
loading.Value = 40
'mymailmsg.Body = document.Text
loading.Value = 50
loading.Value = 60
smtp.Port = 587
loading.Value = 70
smtp.EnableSsl = True
loading.Value = 80
'smtp.Credentials = New System.Net.NetworkCredential("[email protected]", "informatics")
loading.Value = 90
'smtp.Send (mymailmsg)
loading.Value = 100
MsgBox ("You have sent your message!")
loading.Value = 0
Else
End If