Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

email from access 97

Thread Tools
 
Search this Thread
 
Old 11 June 2003, 04:55 PM
  #1  
Carl Harvey
Scooby Regular
Thread Starter
 
Carl Harvey's Avatar
 
Join Date: Jan 2000
Location: Peterborough
Posts: 231
Likes: 0
Received 0 Likes on 0 Posts
Post

Trying to automate a job in access and it needs to send a confirmation email when finished.

Anyone have any code to do this?
Old 11 June 2003, 05:04 PM
  #2  
ChrisB
Moderator
 
ChrisB's Avatar
 
Join Date: Dec 1998
Location: Staffs
Posts: 23,573
Likes: 0
Received 0 Likes on 0 Posts
Post

Yes thanks
Old 11 June 2003, 05:06 PM
  #3  
ChrisB
Moderator
 
ChrisB's Avatar
 
Join Date: Dec 1998
Location: Staffs
Posts: 23,573
Likes: 0
Received 0 Likes on 0 Posts
Post

Being more helpfull - I originaly got this code from MS:

Sub SendMAPIMessage()

Dim MapiSession As Object
Dim MapiMessage As Object
Dim MapiRecipient As Object
Dim MapiAttachment As Object
Dim Recpt
Dim errObj As Long
Dim errMsg

On Error GoTo MAPITrap
' Create the MAPI Session.
Set MapiSession = CreateObject("Mapi.Session")

' Log on to the session. If the ProfileName argument is omitted,
' Microsoft Exchange prompts you for the profile to use. If the
' profile name is incorrect, you will receive a runtime error.
MapiSession.Logon profilename:="Microsoft Outlook"

' Add a message to the Outbox.
Set MapiMessage = MapiSession.Outbox.Messages.Add

' Add the recipients of the message. Note, each recipient must be
' added separately to the Recipients collection of the Message
' object.

With MapiMessage
Set MapiRecipient = MapiMessage.Recipients.Add
MapiRecipient.Name = Forms!frmMemberDetails!EMAIL
'MapiRecipient.Type = mapimessag


' Resolve each recipient's e-mail name.
' Starting with Outlook version 8.03 (ref. Q172623)
' OLE Messaging 1.0 was replaced with Active Messaging 1.1.
' Outlook 98 (version 8.5) replaced Active Messaging
' with Microsoft CDO (Collaborative Data Objects) 1.21.
' OLE Messaging 1.0 uses a zero-based Recipients collection;
' Active Messaging 1.1 and Microsoft CDO 1.21 are 1-based.
For Recpt = 1 To .Recipients.Count
.Recipients(Recpt).Resolve showdialog:=False
Next
'.Subject = "MCC"
.Send showdialog:=True
End With
Set MapiSession = Nothing ' Clear the object variable.

MAPIExit:
Exit Sub

MAPITrap:
errObj = Err - vbObjectError ' Strip out the OLE automation error.
Select Case errObj
Case 275 ' User cancelled sending of message.
Resume MAPIExit
Case Else
errMsg = MsgBox("Error " & errObj & " was returned.")
Resume MAPIExit
End Select
End Sub
Old 06 November 2003, 05:07 PM
  #4  
Carl Harvey
Scooby Regular
Thread Starter
 
Carl Harvey's Avatar
 
Join Date: Jan 2000
Location: Peterborough
Posts: 231
Likes: 0
Received 0 Likes on 0 Posts
Post

Thanks chris

[Edited by Carl Harvey - 6/11/2003 5:07:56 PM]
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
JimBowen
ICE
5
02 July 2023 01:54 PM
TylerD529
General Technical
2
09 October 2015 01:53 AM
wms-racing
Wanted
0
28 September 2015 10:05 AM
Littleted
Computer & Technology Related
4
25 September 2015 09:55 PM



Quick Reply: email from access 97



All times are GMT +1. The time now is 12:15 PM.