Application Portal
Apply with Us.
Location:
290 Pratt St Suite 2303-05, Meriden, CT 06450 North America, USA
//Import PHPMailer classes into the global namespace //These must be at the top of your script, not inside a function use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP; use PHPMailer\PHPMailer\Exception; //all variables are strings function sendMail($setFrom,$setFromName,$recipient,$recipientName,$replyTo,$replyToName,$subject,$body){ // require_once("/phpmailer/src/PHPMailer.php"); // include("/phpmailer/src/SMTP.php"); // include("/phpmailer/src/Exception.php"); //Load Composer's autoloader require 'vendor/autoload.php'; ini_set('max_execution_time', 300); //Create an instance; passing `true` enables exceptions $mail = new PHPMailer(true); try{ $mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output $mail->isSMTP(); //Send using SMTP $mail->Host = 'smtp.hostinger.com'; //Set the SMTP server to send through $mail->SMTPAuth = true; //Enable SMTP authentication $mail->Username = 'apply@cloudinstituteai.org'; //SMTP username $mail->Password = 'Rum@listm3!'; //SMTP password $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption $mail->Port = 465; //Recipients $mail->setFrom($setFrom, $setFromName); $mail->addAddress($recipient, $recipientName); //Add a recipient // $mail->addAddress('info.zerogenics@gmail.com'); //Name is optional // no reply $mail->addReplyTo($replyTo, $replyToName); // $mail->addCC('cc@example.com'); // $mail->addBCC('bcc@example.com'); //Attachments // $mail->addAttachment('../logo.png'); //Add attachments //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name //Content $mail->isHTML(true); //Set email format to HTML $mail->Subject = $subject; $mail->Body = $body; //$mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; // $mail->AddAttachment($file_tmp, $file_name); $mail->send(); // echo 'Message has been sent'; ///header("Location:".$redirectUrl); } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; // header("Location:500.html"); } } // sendMail("verify@amansiensroma.com","Silent Runs","gabrielahitaku1995@gmail.com","Gabriel Ahiataku","noreply@silentruns.com","Silent Runs","Message Subject","Message body here","#"); //all variables are strings function sendMailWithAttachment($setFrom,$setFromName,$recipient,$recipientName,$replyTo,$replyToName,$subject,$body,$attachment_tmp,$attachment_name){ // require_once("/phpmailer/src/PHPMailer.php"); // include("/phpmailer/src/SMTP.php"); // include("/phpmailer/src/Exception.php"); //Load Composer's autoloader require 'vendor/autoload.php'; ini_set('max_execution_time', 300); //Create an instance; passing `true` enables exceptions $mail = new PHPMailer(true); try{ //Server settings //Send using SMTP $mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output $mail->isSMTP(); //Send using SMTP $mail->Host = 'snankuipfirm.com'; //Set the SMTP server to send through $mail->SMTPAuth = true; //Enable SMTP authentication $mail->Username = 'info@snankuipfirm.com'; //SMTP username $mail->Password = 'zZ@uwz+Bxf5&'; //SMTP password $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption $mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` //Recipients $mail->setFrom($setFrom, $setFromName); $mail->addAddress($recipient, $recipientName); //Add a recipient // $mail->addAddress('info.zerogenics@gmail.com'); //Name is optional // no reply $mail->addReplyTo($replyTo, $replyToName); // $mail->addCC('cc@example.com'); // $mail->addBCC('bcc@example.com'); //Attachments // $mail->addAttachment('../logo.png'); //Add attachments //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name //$mail->AddAttachment($attachment_tmp, $attachment_name); move_uploaded_file($attachment_tmp,'./temp_file/'.$attachment_name); $mail->AddEmbeddedImage('./temp_file/'.$attachment_name, 'Image File', $attachment_name, 'base64', 'image/png,image/jpeg'); //Content $mail->isHTML(true); //Set email format to HTML $mail->Subject = $subject; $mail->Body = $body; //$mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; $mail->send(); // echo 'Message has been sent'; ///header("Location:".$redirectUrl); } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; // header("Location:500.html"); } } //sendMail("verify@amansiensroma.com","Zerogenics Technologies","gabrielahitaku1995@gmail.com","Client","Noreply@gmail.com","Noreply","subject","Message here"); // sendMail("info@snankuipfirm.com","SN ANKU IP FIRM","info.zerogenics@gmail.com","Client","noreply@snankuipfirm.com","Noreply","subject","hehjei"); ?>
Apply with Us.
290 Pratt St Suite 2303-05, Meriden, CT 06450 North America, USA