Hi,
Is there anyway that on vb people can send me feedback through textboxes, without having to open up outlook?
Printable View
Hi,
Is there anyway that on vb people can send me feedback through textboxes, without having to open up outlook?
Search here and at www.pscode.com for SMTP...
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:eek: ) 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.
It really is great ;)Quote:
Originally posted by ahara
ps manavo11 - I have never been to that web site you posted - IT IS AWESOME!! Thanks dude.
how about a simple winsock application :)
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
Hello ahara
Do you have to reference any libraries to make this work?
Thanks
David
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
:wave:
That's unfortunate it only works with W2k vers. I have users that are still using W95, W98 and ME.
David