Results 1 to 10 of 10

Thread: email

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2003
    Posts
    121

    email

    Hi,
    Is there anyway that on vb people can send me feedback through textboxes, without having to open up outlook?

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Search here and at www.pscode.com for SMTP...


    Has someone helped you? Then you can Rate their helpful post.

  3. #3
    Fanatic Member ahara's Avatar
    Join Date
    Nov 2003
    Location
    Toronto
    Posts
    531
    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

  4. #4
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Originally posted by ahara
    ps manavo11 - I have never been to that web site you posted - IT IS AWESOME!! Thanks dude.
    It really is great


    Has someone helped you? Then you can Rate their helpful post.

  5. #5
    KING BODWAD XXI BodwadUK's Avatar
    Join Date
    Aug 2002
    Location
    Nottingham
    Posts
    2,176
    how about a simple winsock application
    If you dribble then you are as mad as me

    Lost World Creations Website (XBOX Indie games)
    Lene Marlin

  6. #6
    Fanatic Member ahara's Avatar
    Join Date
    Nov 2003
    Location
    Toronto
    Posts
    531
    as promised...

    VB Code:
    1. 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)
    2.        
    3.     Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
    4.     Const cdoSendUsingPort = 2
    5.     Const cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
    6.     Const cdoSMTPServerPort = "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    7.     Const cdoSMTPConnectionTimeout = "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
    8.     Const cdoSMTPAuthenticate = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
    9.     Const cdoBasic = 1
    10.     Const cdoSendUserName = "http://schemas.microsoft.com/cdo/configuration/sendusername"
    11.     Const cdoSendPassword = "http://schemas.microsoft.com/cdo/configuration/sendpassword"
    12.  
    13.     Dim objConfig   As CDO.Configuration
    14.     Dim objMessage  As CDO.Message
    15.     Dim Fields      As ADODB.Fields
    16.  
    17.     On Error GoTo error_trap
    18.  
    19.     ' Get a handle on the config object and it's fields
    20.  
    21.     Set objConfig = CreateObject("CDO.Configuration")
    22.     Set Fields = objConfig.Fields
    23.  
    24.     ' Set config fields we care about
    25.  
    26.     With Fields
    27.         .Item(cdoSendUsingMethod) = cdoSendUsingPort
    28.         .Item(cdoSMTPServer) = [mail server dns]
    29.         .Item(cdoSMTPServerPort) = 25
    30.         .Item(cdoSMTPConnectionTimeout) = 10
    31.         .Item(cdoSMTPAuthenticate) = cdoBasic
    32.         .Item(cdoSendUserName) = [user name]
    33.         .Item(cdoSendPassword) = [pwd]
    34.         .Update
    35.     End With
    36.    
    37.     Set objMessage = CreateObject("CDO.Message")
    38.  
    39.     Set objMessage.Configuration = objConfig
    40.  
    41.     With objMessage
    42.         .To = [addressee]
    43.         .From = [sender]
    44.         .Subject = [subject line]
    45.         .TextBody = "Reported Error: " & vbCrLf & vbCrLf & theCaller & vbCrLf & desc & vbCrLf & "Error Number: " _
    46.         & num & vbCrLf & "Lessee: " & lessee & vbCrLf & "User: " & theUser & vbCrLf _
    47.         & "Garage ID: " & garage & vbCrLf & "Time reported: " & Time
    48.         '.AddAttachment ("C:\TEST.xls")
    49.         .Send
    50.     End With
    51.  
    52.     Set Fields = Nothing
    53.     Set objMessage = Nothing
    54.     Set objConfig = Nothing
    55.  
    56.     Exit Sub
    57.    
    58. error_trap:
    59.    
    60. 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

  7. #7
    Frenzied Member
    Join Date
    May 2003
    Location
    So Cal
    Posts
    1,564

  8. #8
    Hyperactive Member
    Join Date
    May 2002
    Posts
    434
    Hello ahara

    Do you have to reference any libraries to make this work?

    Thanks

    David

  9. #9
    Fanatic Member ahara's Avatar
    Join Date
    Nov 2003
    Location
    Toronto
    Posts
    531
    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

  10. #10
    Hyperactive Member
    Join Date
    May 2002
    Posts
    434
    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
  •  



Click Here to Expand Forum to Full Width