|
-
Apr 5th, 2004, 03:19 PM
#1
Thread Starter
Lively Member
email
Hi,
Is there anyway that on vb people can send me feedback through textboxes, without having to open up outlook?
-
Apr 5th, 2004, 04:22 PM
#2
-
Apr 5th, 2004, 06:29 PM
#3
Fanatic Member
Hi there;
Every day when I go into work, like many, I hate looking at my e-mail box and the flood of oncoming messages. But for me its a bit different. I have an application written in VB in the testing phase right now, and my error trapping generates messages, and then e-mails them directly to my account. (lucky me ) I am at home now, but I'd be happy to post the code tomorrow when I go into work (project is there)....I am using CDOSYS which will work on any windows based system (except ME)...I learned the code from my boss who spent a great deal of time perfecting it. It is a bit more convoluted than CDONTS, but you can only use the CDONTS API on NT based systems. Reply back, and I will talk to you tomorrow. cheers.
ps manavo11 - I have never been to that web site you posted - IT IS AWESOME!! Thanks dude.
"Knowledge is gained when different people look at the same information in different ways"
- Louis Pasteur
-
Apr 5th, 2004, 06:38 PM
#4
-
Apr 6th, 2004, 05:35 AM
#5
KING BODWAD XXI
how about a simple winsock application
-
Apr 6th, 2004, 07:26 AM
#6
Fanatic Member
as promised...
VB Code:
Public Sub sendErrorEmail(ByVal desc As String, ByVal num As Long, ByVal lessee As String, ByVal garage As Long, ByVal theUser As Integer, ByVal theCaller As String)
Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort = 2
Const cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort = "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout = "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic = 1
Const cdoSendUserName = "http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword = "http://schemas.microsoft.com/cdo/configuration/sendpassword"
Dim objConfig As CDO.Configuration
Dim objMessage As CDO.Message
Dim Fields As ADODB.Fields
On Error GoTo error_trap
' Get a handle on the config object and it's fields
Set objConfig = CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
' Set config fields we care about
With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = [mail server dns]
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = [user name]
.Item(cdoSendPassword) = [pwd]
.Update
End With
Set objMessage = CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
With objMessage
.To = [addressee]
.From = [sender]
.Subject = [subject line]
.TextBody = "Reported Error: " & vbCrLf & vbCrLf & theCaller & vbCrLf & desc & vbCrLf & "Error Number: " _
& num & vbCrLf & "Lessee: " & lessee & vbCrLf & "User: " & theUser & vbCrLf _
& "Garage ID: " & garage & vbCrLf & "Time reported: " & Time
'.AddAttachment ("C:\TEST.xls")
.Send
End With
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
Exit Sub
error_trap:
End Sub
everything inside the square brackets should be strings...just one way to go - all the best
"Knowledge is gained when different people look at the same information in different ways"
- Louis Pasteur
-
Apr 7th, 2004, 09:34 AM
#7
Frenzied Member
-
May 5th, 2004, 03:58 PM
#8
Hyperactive Member
Hello ahara
Do you have to reference any libraries to make this work?
Thanks
David
-
May 5th, 2004, 06:15 PM
#9
Fanatic Member
Hi David;
Yes, you will need possibly two (you may already have one) references:
Microsoft Active X Data Objects 2.x (ADO - this one you may already have...you need it for ADODB.Fields objects)
Microsoft CDO for Windows 2000 Library (for CDO)
The library is the cdosys.dll file which should be in the system directory. I have seen it work on Windows 2000, and a few months ago, they migrated my developing box to XP and it still works fine. Hope that helps. Cheers
"Knowledge is gained when different people look at the same information in different ways"
- Louis Pasteur
-
May 6th, 2004, 11:58 AM
#10
Hyperactive Member
That's unfortunate it only works with W2k vers. I have users that are still using W95, W98 and ME.
David
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|