Send email to two or more

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
patsd102
Veteran Member
Posts: 142
Joined: 2013-01-15 19:59

Send email to two or more

Post by patsd102 » 2020-02-02 22:44

This code here works fine from the main site,

Code: Select all

function tablename_after_insert($data, $memberInfo, &$args){
 
    // to compose a message containing the submitted data,
    // we need to iterate through the $data array
    foreach($data as $field => $value){
        $messageData .= "$field: $value \n";
    }
 
    sendmail(array(
        'to' => '[email protected]',
        'name' => 'Recipient Name',
         
        'subject' => 'A new record needs your attention',
         
        'message' => "The following new record was submitted by {$memberInfo['username']}: \n\n" . $messageData
    ));
     
    return TRUE;
}
Is it possible to add more than 1 recipient. or more
I have tried to add a second with a coma, but then none work,

'to' => '[email protected], [email protected] ',

Thanks
Pat
23.17

patsd102
Veteran Member
Posts: 142
Joined: 2013-01-15 19:59

Re: Send email to two or more

Post by patsd102 » 2020-02-04 19:47

Its okay,
I have found what I need
23.17

utony
Veteran Member
Posts: 93
Joined: 2020-04-03 18:37

Re: Send email to two or more

Post by utony » 2020-04-06 03:33

Can you sent an email to a whole group instead of a single email address? I don't want to hand code users everyday. It would be nice if we could just add"group1" and it would send to everyone in group1. Can this by done?

User avatar
aarlauskas
Veteran Member
Posts: 127
Joined: 2019-04-28 18:03
Location: Medway, UK

Re: Send email to two or more

Post by aarlauskas » 2020-04-06 22:09

just create forwarding email and add all in there? Thats what I use anyway.

Post Reply