* } * @param array $data { * record< * to:list, * subject:string, * ?body_plain:string, * ?body_html:string, * ?from:string, * ?cc:list, * ?bcc:list, * ?reply_to:string, * ?attachments:list> * > * } * @throws Exception if mail can not be sent * @author Christian Fraß */ function send( array $credentials_raw, array $data_raw, array $options = [] ) : void { $options = \array_merge( [ 'implementation' => 'swift', ], $options ); $credentials = new struct_credentials($credentials_raw); $data = new struct_data($data_raw); switch ($options['implementation']) { default: case 'legacy': { implementations\legacy\send($credentials, $data); break; } case 'pear': { implementations\pear\send($credentials, $data); break; } case 'swift': { implementations\swift\send($credentials, $data); break; } case 'phpmailer': { implementations\phpmailer\send($credentials, $data); break; } } } ?>