E-mail criteria (1 Viewer)

Ravi Kumar

Registered User.
Local time
Today, 14:39
Joined
Aug 22, 2019
Messages
162
Dear all,
I have two columns in my dept heads table ,1 is the location & other is their email id .
Now in my report I have three columns,1 is location & 2nd is task name , & the other is task due date .
now i have written a small program to send a mail if any one of the location is set (filtered), using if else.
but i need a code where it sends a mail to everyone related to the location column say out of 10 location ,i have filtered 4 of them.
then it should send a mail to all the 4 dept heads related .
can any one send me the code pls.
 

sxschech

Registered User.
Local time
Today, 02:09
Joined
Mar 2, 2010
Messages
792
Using your example, is the expectation to have one email with 4 recipients in the 'to' or one email for each recipient (4 separate emails)?
 

Ravi Kumar

Registered User.
Local time
Today, 14:39
Joined
Aug 22, 2019
Messages
162
sir ,
I have send one email with 4 recipients in the "TO"....
 

sxschech

Registered User.
Local time
Today, 02:09
Joined
Mar 2, 2010
Messages
792
Wasn't sure from your response if you got it working or still need assistance.

I have send one email with 4 recipients in the "TO"....

Did you mean "I have sent" or "I have to send"?
 

Ravi Kumar

Registered User.
Local time
Today, 14:39
Joined
Aug 22, 2019
Messages
162
Sorry for the typing error..
It is "I have to send".
 

sxschech

Registered User.
Local time
Today, 02:09
Joined
Mar 2, 2010
Messages
792
How far along are you in the code or do you not have any code?
 

Ravi Kumar

Registered User.
Local time
Today, 14:39
Joined
Aug 22, 2019
Messages
162
sir in this video it is showing sending a particular record to particular recipient or recipients .this I have already done.
my requirements is :
* if my 1st column in report has 2 locations say a and b it should send mail to their department heads (stored in dept heads table,1st column location ,2nd department head mail ID) .
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:09
Joined
Sep 21, 2011
Messages
14,238
If I understand you correctly, and that is a big if, you could use DLookUp to get the 2nd department head mail ID for location a, and the same for b.

You really have given nothing to go on, just generic questions, hence generic answers.

To break it down.
Identify the location.
Get the email id's for that location
Send report

Repeat to each location.

For each email id you would concatenate a ";" at the end of the string, then add the next email id and another ";"

You do not really need the last ";" in a string of email ids, but it works just fine, and for the code to remove that last character, I just leave it as is.

HTH
 

Users who are viewing this thread

Top Bottom