backfromthebush
New Member
- Joined
- Jul 2, 2010
- Messages
- 37
Hi all,
I need to write a piece of code that sends an email based on fields in a query.
The query name is "qryCurrentBalancesOwing". It has four fields that are required in the email - Name, EmailMain, EmailAlternate, BalancePos.
I need the code to cycle through the query table and send an email to the persons "EmailMain" and, if they have one, a CC to their "EmailAlternate."
The basic email needs to read something like this:-
Subject line: Name & " - reminder of balance owing!"
Body of email:
Hi [Name],
**This is an automatic generated email!**
This is to advise that final fees are now due.
Your current balance as of today, [todays date], is $[balance pos]
The remainder of the email is just a whole heap of text that doesnt change from person to person.
The actual font and look of the email isn't that important
**IF** it is possible and not too much of challenge, it would be awesome to have an option at the start of the code that brings up a message box vbYesNo to ask the user if they wish to send a "test" email first (this will send the first record in the query to the users own email). Even better would be if the user answers vbYes then an inputbox appears requesting the "test email" address.
Can anyone help me on this?
I need to write a piece of code that sends an email based on fields in a query.
The query name is "qryCurrentBalancesOwing". It has four fields that are required in the email - Name, EmailMain, EmailAlternate, BalancePos.
I need the code to cycle through the query table and send an email to the persons "EmailMain" and, if they have one, a CC to their "EmailAlternate."
The basic email needs to read something like this:-
Subject line: Name & " - reminder of balance owing!"
Body of email:
Hi [Name],
**This is an automatic generated email!**
This is to advise that final fees are now due.
Your current balance as of today, [todays date], is $[balance pos]
The remainder of the email is just a whole heap of text that doesnt change from person to person.
The actual font and look of the email isn't that important
**IF** it is possible and not too much of challenge, it would be awesome to have an option at the start of the code that brings up a message box vbYesNo to ask the user if they wish to send a "test" email first (this will send the first record in the query to the users own email). Even better would be if the user answers vbYes then an inputbox appears requesting the "test email" address.
Can anyone help me on this?