Results 1 to 2 of 2

Thread: Send e-mail - I Give up!

  1. #1

    Thread Starter
    Addicted Member Monkey Man's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere deep in the Caribbean.....
    Posts
    202

    Unhappy Send e-mail - I Give up!

    O.k, sorry but I'm going to ask, I've read the demo's (cos there are loads) the posts (even more) and consulted MSDN, but I'm still stuck.

    I have a project which will need to send a text file from a field based salesperson (they have laptops) to a default e-mail address. The file is only small (about 20Kb). Outlook will be the only app used as it is installed on all the computers. What is the best way to do this and what info will I need from the co. (I already have the SMTP & PoP address from them ).

    What is the best way to do this....

    Now originally, I wanted to make sure that the e-mail was sent. As this is a request which the salesperson will be sending in, a date is recorded in the database as to when it was sent. The code i'm using at the moment only puts the e-mail in the outbox and then the user must send it. But I need to know the date it was actually sent . However, if this just complicated the issue then I shall stick with what I have...

    Please help

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177
    Would something like this help? It will send the file without the need for the user to send it from the Outbox.
    VB Code:
    1. Private Sub SendIt(MyFile As String)
    2.    Dim objOutlook As New Outlook.Application
    3.    Dim objOutlookMsg As Outlook.MailItem
    4.  
    5.    'Open the file to be sent
    6.    Open MyFile For Input As #1
    7.    
    8.    'Create new message
    9.    Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
    10.  
    11.    With objOutlookMsg
    12.     .To = "userid@domain"
    13.     .Subject = "Field data for Joe Blow"
    14.     .Body = input$(LOF(1), #1)
    15.     .Send
    16.   End With
    17.  
    18.    Set objOutlookMsg = Nothing
    19.  
    20.    'Close Outlook instance: Important!
    21.    Set objOutlook = Nothing
    22.  
    23.    Close #1
    24.    
    25. End Sub
    You don't specify as to where the database is located, so I can't offer anything more at this time.

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