api_key = $api_key; parent::__construct( $this->base_url ); // Set 30-second timeout for SMTP2GO requests $this->set_additional_args( array( 'timeout' => 30 ) ); } private function get_headers() { return array( 'Content-Type' => 'application/json', 'X-Smtp2go-Api-Key' => $this->api_key, 'accept' => 'application/json', ); } public function send( $content ) { $content = json_encode( $content ); return $this->request( 'POST', '/send', $this->get_headers(), $content, $this->email_sent_code ); } } }