Consulting

Results 1 to 4 of 4

Thread: send email

  1. #1
    VBAX Tutor
    Joined
    Oct 2007
    Posts
    210
    Location

    send email

    I would like an email to be sent to me when the user enters in a new record. We use Microsoft Outlook. How can I send an email? (Just need text, no file attached).
    "The amount of stupid people in the world is God's way of punishing the smart people" - protean_being

  2. #2
    [vba]
    Dim OutlookApp As Object
    Dim Mail as Object

    Set OutlookApp = CreateObject("Outlook.Application")
    Set Mail = OutlookApp.CreateItem(0)
    With Mail
    .To = recipient@something.com
    .Subject = "Your subject"
    .Body = "insert text here"
    .Display
    End With
    [/vba]

    This will display the message and the user will need to click send. You can use .Send in the With statement, but unfortunately it displays an alert which can't be suppressed by "DisplayAlerts = False".
    there is a way around, but I think it's fairly complex...
    Phil J.

  3. #3
    VBAX Tutor
    Joined
    Oct 2007
    Posts
    210
    Location
    if there is a way around it I would like to know. Please someone post if you know. Thanks!
    "The amount of stupid people in the world is God's way of punishing the smart people" - protean_being

  4. #4
    VBAX Tutor
    Joined
    Oct 2007
    Posts
    210
    Location
    What about attachments?
    "The amount of stupid people in the world is God's way of punishing the smart people" - protean_being

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •