Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Nov 2005
    Location
    London, Gtr London, United Kingdom
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    email from Access 2000 (2000/sp3)

    Hi. i saw this in a previous thread.....

    Private Sub Command393_Click()
    On Error GoTo ErrHandler

    DoCmd.SendObject _
    To:="someone@somewhere.com", _
    Subject:="Your Confirmation from the Whistler Resort and Club", _
    MessageText:="This is your confirmation for your Whistler Vacation. " & vbCrLf & _
    "You will need Adobe Reader to open this attachment. " & vbCrLf & _
    "It is available at http://www.adobe.com/products/acrobat/readstep2.html", _
    EditMessage:=True
    Exit Sub

    ErrHandler:
    If Err <> 2501 Then ' Ignore error 2501 = canceled.
    MsgBox Err.Description, vbExclamation
    End If
    End Sub

    .... and i was wondering to replace "someone@somewhere.com" with data from a field in my form?

    Many thanks in advance.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: email from Access 2000 (2000/sp3)

    Simply change

    To:="someone@somewhere.com", _

    to

    To:=Me.txtEmail, _

    where txtEmail is the name of the control / field containing the e-mail address.

  3. #3
    Star Lounger
    Join Date
    Nov 2005
    Location
    London, Gtr London, United Kingdom
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: email from Access 2000 (2000/sp3)

    Brilliant Hans. Works a treat. I had a feeling it would be simple.

    Many thanks

    Thom

  4. #4
    Star Lounger
    Join Date
    Nov 2005
    Location
    London, Gtr London, United Kingdom
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: email from Access 2000 (2000/sp3)

    One last quick question. If I have access to a shared mail box, is it possible to have it sent from that, i.e. From:="myshared@myshared.com".... though I know that there doesn't work!!?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: email from Access 2000 (2000/sp3)

    DoCmd.SendOject doesn't let you specify the sender. You could use Automation to control Outlook from Access. You can then either log into Outlook using the correct profile, or specify the SentOnBehalfOfName property of the e-mail.

    If you do a search in this forum for Outlook.Application, you'll find several examples of automating Outlook from Access. See WendellB

Posting Permissions

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