0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.224.51.153


Current Path : /var/www/html/admission/src/
Upload File :
Current File : /var/www/html/admission/src/sendzohomail.php

<?php

    function sendZohoMail($emailid, $subject, $message, $apiKey, $supemail){
        $curl = curl_init();
        $api = base64_decode($apiKey);
      
        $emailData = json_encode([
            "from" => [
                "address" => $supemail
            ],
            "to" => [
                [
                    "email_address" => [
                        "address" => $emailid,
                        // "name" => "Arun Kumar"
                    ]
                ]
            ],
            "subject" => $subject,
            "htmlbody" => $message
        ]);

        curl_setopt_array($curl, array(
            CURLOPT_URL => "https://api.zeptomail.com/v1.1/email",
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => "",
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 30,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => "POST",
            CURLOPT_POSTFIELDS => $emailData,
            CURLOPT_HTTPHEADER => array(
                "accept: application/json",
                "authorization: $api",
                "cache-control: no-cache",
                "content-type: application/json",
            ),
        ));

        $response = curl_exec($curl);
        $err = curl_error($curl);

        curl_close($curl);

        if ($err) {
            $res = "cURL Error #:" . $err;
        } else {
            $res = $response;
        }

        return $res;
    }
?>