Answered by:
NEED HELP SENDING EMAIL IN MSACCESS THROUGH OUTLOOK 2016

Question
-
I AM TRYING TO SEND AN EMAIL TO A COMPANY THAT FORWARDS THE INFORMATION BELOW TO A POLICE OFFICER'S PHONE THROUGH AN APP ( SEE ACTIVE911.COM). MS ACCESS WANTS ME TO SEND THE INFO AS AN ATTACHMENT BUT THEY ARE
HAVING DIFFICULTY READING IT. IS THERE A WAY TO SEND THIS DATA STRAIGHT TO OUTLOOK EXPRESS WHERE IT PUTS THE INFORMATION INTO THE BODY OF THE EMAIL WHERE THEY CAN READ IT AND IT DOES NOT HAVE TO BE AN ATTACHMENT. I AM STUMPED ON THIS ONE.
NEED HELP ! BELOW IS AN EXAMPLE OF THE INFORMATION THAT I WANT TO PULL FROM A REPORT AND SEND TO THE BODY OF THE EMAIL MESSAGE AND THEN I CAN SEND IT TO THEM.
San Benito CISD Police
CASE NUMBER 201705051452
TYPE OF INCIDENT: UNKNOWN NATURE
Address 2115 N WILLIAMS ROAD
LOCATION: TEXAS ACADEMY SCHOOL
CALLER: MR JOE GARCIA
UNIT ASSIGNED 105
NARRATIVE REQ TO SPEAK TO OFFICER ABOUT ANYTHING HE WANTS (EXAMPLEOF DETAIL OF CALL.THANK YOU IN ADVANCE
BORDERCHILDREN
Friday, May 5, 2017 10:12 PM
Answers
-
For example:
Dim strMsg As String strMsg = "Case Number = " & Me.CaseNumber & vbCrLf strMsg = strMsg & "Type of Incident: " & Me.IncidentType & vbCrLf etc... DoCmd.SendObject acSendNoObject, MessageText:= strMsg, EditMessage:=True
Hope it helps...
- Marked as answer by borderchildren Sunday, May 7, 2017 3:01 AM
Saturday, May 6, 2017 1:44 AM
All replies
-
Hi, If you're using the SendObject method or macro, you can simply construct the email message body from the table's data and use it for the Message argument. Hope it helps...Friday, May 5, 2017 10:53 PM
-
For example:
Dim strMsg As String strMsg = "Case Number = " & Me.CaseNumber & vbCrLf strMsg = strMsg & "Type of Incident: " & Me.IncidentType & vbCrLf etc... DoCmd.SendObject acSendNoObject, MessageText:= strMsg, EditMessage:=True
Hope it helps...
- Marked as answer by borderchildren Sunday, May 7, 2017 3:01 AM
Saturday, May 6, 2017 1:44 AM -
If you are using the web-based version of Outlook Express, you cannot use automation and the SendObject command will not work. You need to purchase the commercial Outlook version. The SendObject command opens the default e-mail program and cannot open Outlook Express. I use the web-based version of Outlook Express and there is no way to use automation with it.Saturday, May 6, 2017 2:51 PM
-
@Lawrence
What about CDO mail or directly working with the SMTP server. As long as you have the account credentials they should work.
Daniel Pineault, 2010-2016 Microsoft MVP
Professional Support: http://www.cardaconsultants.com
MS Access Tips and Code Samples: http://www.devhut.netSaturday, May 6, 2017 5:12 PM -
I am using outlook2016 and msaccess 2016. I am away from my program now but will try this vb code later. I am assumming I put it in a module and call it from my MsAccess form as an on click event. Just not sure how it pulls the data from my report. I am new at this coding thing. Thanks !Saturday, May 6, 2017 5:51 PM
-
Hi, If you have a form showing the data you want to email, you can add a button on it and use the SendObject method like I showed above. You can try it out a little at a time sending the email to yourself to see what they'll get.Saturday, May 6, 2017 6:53 PM
-
Daniel:
I wouldn't know. He asked about Outlook Express, and I do know if he's using the web-based version, it does not support any automation with ACCESS. If he's using the full commercial version, then it shoud be no problem at all. There are thousands of code examples all over the place.
Saturday, May 6, 2017 8:34 PM -
I use the web-based version of Outlook Express and there is no way to use automation with it.
Hi Lawrence,
Does the web-based version of Outlook Expres the same as the "old" version? And how can I get it?
Imb.
Saturday, May 6, 2017 9:46 PM -
Imb-hb:
Sorry, I don't know what the "old" version is. I used to use Live Mail (HotMail), but Microsoft disabled it and one day Outlook just appeared on my Internet Explorer. As a result, my old e-mail was just gone. Also, I cannot set my default e-mail system to Outlook. It remains Live Mail even though it has been disabled. I assume you can get Outlook Express if you go to OutLook.com and sign up for it, but as I said, it just appeared one day on my browser. And you cannot link your old Live Mail account to Outlook like you can with g-mail. At least I have been unable to do it. The biggest problem for me was I had an ACCESS application I wrote that used the SendObject command. I had to delete that functionality because if the user was using Outlook Express, it wouldn't work any more.
Saturday, May 6, 2017 11:31 PM -
.theDBguy ,
Your a genius. I put your code in and it worked and then I added the additional fields that I
need to send them and that worked.
Thank you so much !
My program is now complete !
borderchildren
Sunday, May 7, 2017 3:03 AM -
.theDBguy ,
Your a genius. I put your code in and it worked and then I added the additional fields that I
need to send them and that worked.
Thank you so much !
My program is now complete !
borderchildren
Hi, You're welcome. We're all happy to assist. Glad to hear you got it to work. Good luck with your project.Sunday, May 7, 2017 3:20 AM