email notification

  • Thread starter Thread starter thcode
  • Start date Start date
T

thcode

I know I can use the send object to send a pre formatted email but I want to
send confirmation email when people enter information and notification emails
when data is entered that a certain person needs to address.

Thank you for your help,
Tina
 
I'm strictly a newbie, but I have both Access and Outlook and when I want
Access to send an email I used code like this:

Set ol = CreateObject("Outlook.Application")
Set eml = ol.CreateItem(0)
eml.To = "(e-mail address removed)"
eml.CC = "(e-mail address removed)"
eml.Subject = "Subject of email"
eml.Display 'I think is like setting Visible to True

When I'm sending HTML email I have to search for a particular spot in my
default HTML email and insert my text there, possibly with futher HTML code
embedded. Once I've figured out I can simply set eml.HTMLBody. But for
system notifications I imagine plain text is good enough, so you'd probably
use this:

eml.Body = "This is the text of the email."
eml.Attachments.Add "C:\Path\Filename.xls", olByValue
eml.GetInspector.Activate

Attachments are optional, of course. The Activate method, if I remember
correctly, activates that screen so I can look at it, modify whatever I want
to and then send it manually; no doubt you can add code to the above to send
it automatically if that's what you want.

Now, I know there are simpler things you can do to send email NOT using
Outlook. I'm not an SMTP geek, though; probably others can improve on the
above.
 
Back
Top