代码还可以,我收到了电子邮件,但无法获得实际的pdf文件大小。只是 1kb我得到了文件大小
代码还可以,我收到了电子邮件,但无法获得实际的pdf文件大小。只是 1kb我得到了文件大小
代码还可以,我收到了电子邮件,但无法获得实际的pdf文件大小。只是 1kb我得到了文件大小
代码还可以,我收到了电子邮件,但无法获得实际的pdf文件大小。只是 1kb我得到了文件大小
代码还可以,我收到了电子邮件,但无法获得实际的pdf文件大小。只是 1kb我得到了文件大小
代码还可以,我收到了电子邮件,但无法获得实际的pdf文件大小。只是 1kb我得到了文件大小
代码还可以,我收到了电子邮件,但无法获得实际的pdf文件大小。只是 1kb我得到了文件大小
代码还可以,我收到了电子邮件,但无法获得实际的pdf文件大小。只是 1kb我得到了文件大小
代码还可以,我收到了电子邮件,但无法获得实际的pdf文件大小。只是 1kb我得到了文件大小
代码还可以,我收到了电子邮件,但无法获得实际的pdf文件大小。只是 1kb我得到了文件大小 代码可以,我收到电子邮件,但无法得到实际的pdf文件大小。只是 1kb我得到了文件大小
代码还可以,我收到了电子邮件,但无法获得实际的pdf文件大小。只是 1kb我得到了文件大小
代码还可以,我收到了电子邮件,但无法获得实际的pdf文件大小。只是 1kb我得到了文件大小
代码还可以,我收到了电子邮件,但无法获得实际的pdf文件大小。只是 1kb我得到了文件大小
×查询
请填写此表单以提交查询。
名称
您的查询<label for="file"><b>Upload CV </b></label><br> <input type="file" name="photo" class="form-control" accept=".pdf" required/><br> <p>By creating an account you agree to our <a href="#" style="color:dodgerblue">Terms & Privacy</a>.</p> <div class="clearfix"> <button type="submit" class="signupbtn btnsubmityourquery" name="submit" value="submit" id="submit">Submit
<?php
$name = $_POST['name'];
$file_name = $_FILES['photo']['name'];
$tmp_name = $_FILES["photo"]["tmp_name"];
$file_type = $_FILES["photo"]["type"];
$uploadOk = 1;
if(isset($_POST['submit'])) {
if(isset($_FILES['photo'])) {
require 'sendgrid-php/vendor/autoload.php';
//Dotenv::load(__DIR__);
$sendgrid_apikey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$sendgrid = new SendGrid($sendgrid_apikey);
$url = 'https://api.sendgrid.com/';
$pass = $sendgrid_apikey;
$documentList = array(
$file_name => "@" . realpath($file_name )
);
$params = array(
'to' => "xxxxxxxxxxxxxx@gmail.com",
//'toname' => "Gmail yyy",
'from' => "yyyyyyyyyyyyyyy@windowmaker.com",
'fromname' => 'yy Enquired',
'subject' => "yy Enquiry Form",
'html' => "<strong>eCatalog Enquiry Form</strong><br>
Name : ".$name.",<br>",
);
if(count($documentList)>0){
foreach($documentList as $fileName=>$documentPath){
$params['files['.$fileName.']'] = $documentPath;
}
}
$request = $url.'api/mail.send.json';
// Generate curl request
$session = curl_init($request);
// Tell PHP not to use SSLv3 (instead opting for TLS)
curl_setopt($session, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
curl_setopt($session, CURLOPT_HTTPHEADER, array('Authorization: Bearer ' . $sendgrid_apikey));
// Tell curl to use HTTP POST
curl_setopt ($session, CURLOPT_POST, true);
// Tell curl that this is the body of the POST
curl_setopt ($session, CURLOPT_POSTFIELDS, $params);
// Tell curl not to return headers, but do return the response
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// obtain response
$response = curl_exec($session);
$err = curl_error($session);
if (!curl_errno($session)) {
switch ($http_code = curl_getinfo($session, CURLINFO_HTTP_CODE)) {
case 200:
echo "<script>
alert('Thank you for your enquiry. The Windowmaker team will get back to you as soon as possible');
window.location.href='#';
</script>";
break;
default:
echo 'Unexpected HTTP code: ', $http_code, "\n";
echo "cURL Error #:" . $err;
}
}
curl_close($session);
}
}
?>