Access 2010 - Using Macros to send an email from access to outlook

PrettyMess

Board Regular
Joined
Feb 10, 2015
Messages
66
Hi All,

I have been asked to make my database send emails when a new record is added or a change is made to the 'mobex' I have managed to get it to record the information in another table but I cant get the email to send

I also don't want it to alert the member of staff that an email is being sent

I need to set this up in a macro to make management of this easier as I will not be maintaing this going forward

If anyone could help it would be greatly appreciated

I have input this data into the after insert command on my table:

Code:
setlocalvar name varBodyTitle
expression = concat('HTML Style goes in here wont display right',[MobileNumber],"Update to Mobex",'<\h2><br>')

setlocalvar name varBodyMain
expression = concat("Look at asap",'<br>',"The following mobex has changed from",[OldValue],"to",[NewValue],'<br>')

setlocalvar name varBodyEnd
concat('<br><br><i>',"this message is sent from an unmonitored email address",'</i>')

sendemail

To ="email address"
cc
bcc
subject ="New Update"
Body =concat([varBodyTitle],[varBodyMain],[varBodyEnd])


Thanks
Paula
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,214,957
Messages
6,122,472
Members
449,087
Latest member
RExcelSearch

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top