| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/b2bzend/cronjob/ |
Upload File : |
<?php
$url = 'https://api.elasticemail.com/v2/email/send';
try {
$filename = "1846-12938.csv";
$fullPath = "https://globaltravelexchange.com/SendEmailCSV/";
//$fullPath = $_SERVER['DOCUMENT_ROOT'] . '/SendEmailCSV/';
//$file_name_with_full_path = realpath('D:/Html/users/userweb733/Html/SendEmailCSV/'.$filename);
$file_name_with_full_path = realpath($fullPath . $filename);
$emailSenderKey = '55675070CEB289813C846EE77FDD76D2DDF107FE8D2FD6042C200730DD8E63AD04719C5BA3F5A91ECD3E3FAA9E5F3B56';
$post = array(
'from' => "prashant@catpl.co.in",
'fromName' => "Prashant Kumar Gupta",
'apikey' => $emailSenderKey,
'subject' => "Test By Prashant",
'file_contacts' => new CurlFile($file_name_with_full_path, 'text/csv', $filename),
'mergesourcefilename' => $filename,
'bodyHtml' => "Hello HTML",
'bodyText' => "Hello Text",
'isTransactional' => false
);
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $post,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_SSL_VERIFYPEER => false
));
$result = curl_exec($ch);
curl_close($ch);
print_r($result);die('dddddd');
} catch (Exception $ex) {
echo $result = $ex->getMessage();
}
echo "Prashant"; exit;
function getRealIpAddr() {
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
}
echo $ip = getRealIpAddr();
echo "<br>";
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
echo "<pre>";
print_r($details);
echo $details->city;
exit;
require_once 'init.php';
error_reporting(E_ALL);
$subject = "Test BY Prashant";
$bodyText = "Hello";
$emailId = "prashant@catpl.co.in";
$smtpUserName = "prashant.gupta11687@gmail.com";
$smtpPassword = "test@2017";
//$smtpPort ="465";
$smtpPort = "465";
//$smtpHost ="secure.emailsrvr.com";
$smtpHost = "smtp.gmail.com";
$fromEmail = "gpurwar@gmail.com";
$fromName = "Gaurav Kumar Gupta";
$mailConfig = array(
'ssl' => 'ssl',
'auth' => 'login',
'port' => $smtpPort,
'username' => $smtpUserName,
'password' => $smtpPassword
);
$transport = new Zend_Mail_Transport_Smtp($smtpHost, $mailConfig);
$mail = new Zend_Mail("iso-8859-1");
$mail->addTo($emailId)
// ->addBcc('prashant@catpl.co.in')
->setSubject($subject)
->setBodyHtml($bodyText)
->setFrom($fromEmail, $fromName);
try {
$result = $mail->send($transport);
} catch (Exception $err) {
$result = $err->getMessage();
}
echo "<pre>";
print_r($result);
exit;
?>