I want to create a button on the access form to send some details to the guest to check data is typed in correctly.
You have no idea how difficult this appears to be ~ I have been on Forums, on Microsoft's most valued members and searched high and low ~ no luck!
I have tried Outlook.Application e.g.
Dim outApp As Outlook.Application, outMsg As MailItem Dim vMessage As String vMessage = "Please can you reply if the following details are wrong. Thank you. " Set outApp = CreateObject("Outlook.Application") Set outMsg = outApp.CreateItem(olMailItem) With outMsg '.Importance = olImportanceHigh .To = Me.[Work E-Mail] '.CC = "CC EMAIL ADDRESS GOES HERE" '.BCC = "BCC EMAIL ADDRESS GOES HERE" .Subject = "Database error checking" vMessage = vMessage & Me.Firstname & " " & Me.Name vMessage = vMessage & "Mobile: " & Me.Mobile_Telephone vMessage = vMessage & "Flight: " & Me.In_Flight_Number vMessage = vMaeeage & " Passport: " & Me.Passport_Number
' .Body = "YOUR_E-MAIL_MESSAGE_GOES_HERE" .body = vMessage '.Attachments.Add "YOUR FILE PATH AND NAME", , , "YOUR FILES NAME" ' If you want the screen to be seen then add the following line .Display .Send 'End With
Set outApp = Nothing Set outMsg = Nothing
And set object e.g. (complains Server is not a defined variable ~ I guess there was some dimming that I did not catch)
Set objmail = Server.CreateObject("CDONTS.NewMail") With objMail .From = fromname .To = toname .Subject = messagehead .Body = messagetext .BodyFormat = CdoBodyFormatText .MailFormat = CdoMailFormatText .Importance = CdoNormal .Send End With Set objMail = Nothing
Neither work. Am I going mad? Is it really this difficult?
Thanks for looking Paul
This conversation is currently closed to new comments.
Thank you for this pointer. I have already checked this, and the right library was not ticked, however this has not solved the overall problem. Regards Paul
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
How to send emails from Access 2000
I want to create a button on the access form to send some details to the guest to check data is typed in correctly.
You have no idea how difficult this appears to be ~ I have been on Forums, on Microsoft's most valued members and searched high and low ~ no luck!
I have tried Outlook.Application e.g.
Dim outApp As Outlook.Application, outMsg As MailItem
Dim vMessage As String
vMessage = "Please can you reply if the following details are wrong. Thank you. "
Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
.To = Me.[Work E-Mail]
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
.Subject = "Database error checking"
vMessage = vMessage & Me.Firstname & " " & Me.Name
vMessage = vMessage & "Mobile: " & Me.Mobile_Telephone
vMessage = vMessage & "Flight: " & Me.In_Flight_Number
vMessage = vMaeeage & " Passport: " & Me.Passport_Number
' .Body = "YOUR_E-MAIL_MESSAGE_GOES_HERE"
.body = vMessage
'.Attachments.Add "YOUR FILE PATH AND NAME", , , "YOUR FILES NAME"
' If you want the screen to be seen then add the following line
.Display
.Send
'End With
Set outApp = Nothing
Set outMsg = Nothing
And set object e.g. (complains Server is not a defined variable ~ I guess there was some dimming that I did not catch)
Set objmail = Server.CreateObject("CDONTS.NewMail")
With objMail
.From = fromname
.To = toname
.Subject = messagehead
.Body = messagetext
.BodyFormat = CdoBodyFormatText
.MailFormat = CdoMailFormatText
.Importance = CdoNormal
.Send
End With
Set objMail = Nothing
Neither work. Am I going mad? Is it really this difficult?
Thanks for looking
Paul