
Joob
Members-
Posts
18 -
Joined
-
Last visited
Everything posted by Joob
-
Good, I am having a problem with UTF-8 decryption in Subject .. Imagine that a Smile appears in the Subject, it appears with this encoding And I wanted it to appear this way I already tried to do some research, but they are not working .. Regards
-
Hello, I have a problem with my code.. I cant do download attachment, when I click on link "image.jpg", the link appears this way "www.site.com/image.jpg" but the link doesnt existe. $id = $_POST['id']; $pdo = new PDO("sqlite:mydb.db"); $email = $pdo->query("SELECT * FROM `myemails` WHERE `id`='$myid'")->fetch(PDO::FETCH_ASSOC); $email_body = base64_decode($email['message']); $letter_html = ""; //$op_getKey = preg_match_all("/Content-Type: multipart\/alternative; boundary=\"(.*?)\"/", $email_body, $getKey); //$op_getKey = preg_match_all("/alternative; boundary=\"(.*)\"/", $email_body, $getKey); $op_getKey = preg_match_all("/boundary=\"(.*)\"/", $email_body, $getKey); //$has_attachment = preg_match_all("/multipart\/mixed/; boundary=\"(.*?)\"/", $email_body, $attachment); $has_attachment = preg_match_all("/multipart\/mixed/", $email_body, $attachment); if ($op_getKey) { if ($has_attachment) { $mailParts = explode("--" . $getKey[1][1], $email_body); $attachParts = explode("--" . $getKey[1][0], $email_body); $get_attach_name=preg_match_all("/filename=\"(.*?)\"/", $attachParts[2], $attach_name); $get_attach_type=preg_match_all("/Content-Type: (.*?);/", $attachParts[2], $attach_type); $pure_code = explode("\n\n",$attachParts[2]); $pure_code = str_replace("\r","",$pure_code[1]); $pure_code = str_replace("\n","",$pure_code); }else{ $mailParts = explode("--" . $getKey[1][0], $email_body); } Can you give me some help implementing this code in my code? $savedir = __DIR__ . '/attachment/'; $myemail = $email->search('ALL'); if ($myemail ) { rsort($myemail ); foreach ($myemail as $my2email) { foreach ($my2email->getAttachments() as $attachment) { $savepath = $savedir . $attachment->getFilename(); file_put_contents($savepath, $attachment); } } } So that it is possible, whenever you receive an email, that the file go to the "attachment" folder and can download the image or file .. Regards
-
When I send an email to my service, I receive the email but I cant download the anex .. :/ doesnt work the link of file (jpg png zip rar) ..
-
but this service is only for receiving emails .. it does not serve to send .. this is an email pipe
-
Hi, How can I put the script more random, not just a count of 5 out of 5 .. I wanted, for example, a count of 5 numbers after 7, after 3, after 6 or 15 etc .... a more random count and not only 5 in 5 or 2 in 2 etc. <script> function handleTickInit(tick) { // update the value every 5 seconds var interval = Tick.helper.duration(5, 'seconds'); // value to add each interval var valuePerInterval = 5; // offset is a fixed date in the past var offset = Tick.helper.date('2017-03-01'); // uncomment lines below (and comment line above) if you want offset be set to the first time the user visited the page // var offset = parseInt(localStorage.getItem('tick-value-counter-offset') || Date.now(), 10); // localStorage.setItem('tick-value-counter-offset', offset); // start updating the counter each second Tick.helper.interval(function(){ // current time in milliseconds var now = Date.now(); // difference with offset time in milliseconds var diff = now - offset; // total time since offset divide by interval gives us the amount of loops since offset var loops = diff / interval; // this will make sure we only count completed loops. loops = Math.floor(loops); // multiply that by the value per interval and you have your final value tick.value = loops * valuePerInterval; }, 1000); } </script> I already used this code, but it did not work very well var x = Math.floor((Math.random() * 15) + 1); I wanted to deploy in my script, something like this https://jsfiddle.net/os30L03q/ I do not know if they can help me. Best Regards
-
Thank for ur reply. I am using email pipe, with SQL based. I'm using it like this <?php $id = $_POST['id']; $pdo = new PDO("sqlite:mydb.db"); $email = $pdo->query("SELECT * FROM `emails` WHERE `id`='$id'")->fetch(PDO::FETCH_ASSOC); $email_body = base64_decode($email['message']); $letter_html = ""; //$op_getKey = preg_match_all("/Content-Type: multipart\/alternative; boundary=\"(.*?)\"/", $email_body, $getKey); //$op_getKey = preg_match_all("/alternative; boundary=\"(.*)\"/", $email_body, $getKey); $op_getKey = preg_match_all("/boundary=\"(.*)\"/", $email_body, $getKey); //$has_attachment = preg_match_all("/multipart\/mixed/; boundary=\"(.*?)\"/", $email_body, $attachment); $has_attachment = preg_match_all("/multipart\/mixed/", $email_body, $attachment); if ($op_getKey) { if ($has_attachment) { $mailParts = explode("--" . $getKey[1][1], $email_body); $attachParts = explode("--" . $getKey[1][0], $email_body); $get_attach_name=preg_match_all("/filename=\"(.*?)\"/", $attachParts[2], $attach_name); $get_attach_type=preg_match_all("/Content-Type: (.*?);/", $attachParts[2], $attach_type); $pure_code = explode("\n\n",$attachParts[2]); $pure_code = str_replace("\r","",$pure_code[1]); $pure_code = str_replace("\n","",$pure_code); }else{ $mailParts = explode("--" . $getKey[1][0], $email_body); } //$letter_text = str_replace('Content-Type: text/plain; charset="UTF-8"', '', $mailParts[1]); //echo $letter_text; $the_mail = $mailParts[2]; $to_replace = array( 'Content-Type: text/html; charset="UTF-8"', 'Content-Type: text/html; charset=UTF-8', 'Content-Type: text/html; charset="utf-8"', 'Content-Type: text/html; charset=utf-8', 'Content-Type: text/html; charset="iso-8859-1"', 'Content-Type: text/html; charset=iso-8859-1', 'Content-Type: text/html; charset="ISO-8859-1"', 'Content-Type: text/html; charset=ISO-8859-1', 'Content-Type: text/plain; charset="iso-8859-1"', ); foreach ($to_replace as $k => $v) { $the_mail = str_replace($to_replace[$k], '', $the_mail); } //$the_mail = str_replace('Content-Type: text/html; charset="UTF-8"', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset=UTF-8', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset="utf-8"', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset=utf-8', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset="iso-8859-1"', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset=iso-8859-1', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset="ISO-8859-1"', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset=ISO-8859-1', '', $the_mail); if (preg_match_all("/Content-Transfer-Encoding: quoted-printable/", $the_mail, $mailToDecode)) { $message_to_decode = str_replace('Content-Transfer-Encoding: quoted-printable', '', $the_mail); $letter_html = quoted_printable_decode($message_to_decode); }elseif(preg_match_all("/Content-Transfer-Encoding: base64/", $the_mail, $mailToDecode)){ $message_to_decode = str_replace('\r', '', $the_mail); $message_to_decode = str_replace('\n', '', $message_to_decode); $message_to_decode = str_replace('Content-Transfer-Encoding: base64', '', $message_to_decode); $letter_html = base64_decode($message_to_decode); // $letter_html = $message_to_decode; } else { $letter_html = $the_mail; } // echo $letter_html; } else { $mailParts = explode("\n\n", $email_body); foreach ($mailParts as $k => $v) { if ($k > 0) { $letter_html .= $v . "\n\n"; } } if(preg_match_all("/Content-Transfer-Encoding: base64/", $email_body, $mailToDecode)){ $message_to_decode = str_replace('\r', '', $letter_html); $message_to_decode = str_replace('\n', '', $message_to_decode); $letter_html = base64_decode($message_to_decode); // $letter_html = $message_to_decode; } } ?> And I call it like this <strong><?=$lang[$xlang][5]?></strong>: <a target="_blank" href="https://site.com/<?=$attach_type[1][0]?>;base64,<?=$pure_code?>"><?=$attach_name[1][0]?></a> When I send an email to my website to receive the email, the anex doesn't work (the link) on my website.. can not download..
-
Hello guys, I'm having trouble receiving attachments in email .. When I send an attachment, it says "attachment: file1.jpg" or "attachment: file.rar" all ok .. but when I click on it, the link is not correct, and gives me a link with a huge extension. Next function $has_attachment = preg_match_all("/multipart\/mixed/", $email_body, $attachment); if ($op_getKey) { if ($has_attachment) { $mailParts = explode("--" . $getKey[1][1], $email_body); $attachParts = explode("--" . $getKey[1][0], $email_body); $get_attach_name=preg_match_all("/filename=\"(.*?)\"/", $attachParts[2], $attach_name); $get_attach_type=preg_match_all("/Content-Type: (.*?);/", $attachParts[2], $attach_type); $pure_code = explode("\n\n",$attachParts[2]); $pure_code = str_replace("\r","",$pure_code[1]); $pure_code = str_replace("\n","",$pure_code); }else{ $mailParts = explode("--" . $getKey[1][0], $email_body); } And I'm making the call that way <a target="_blank" href="data:<?=$attach_type[1][0]?>;base64,<?=$pure_code?>"> <?=$attach_name[1][0]?> </a> I have this code in my another file (attachment.php) <?php if (isset($_GET['attachment'])) { } ?> Regards
-
I have an email service .. and when sending an attachment to my site of my email, the link in the attachment is not functional, give me a link that does not exist .. that is, I wanted it when I sent an image, which opened in the browser and when it was a file, you can download it. The other problem is, when sending or receiving picture emails, in the text field, I get the entire email encoded, as it is in the attachment above. I do not know if you can understand my question.
-
Hello, How can I put the most random script, and not only a count of 5 in 5 .. I wanted, for example, a count of 5 after 7, after 3, after 2, after 6 or 15 etc .... numbers .. a more random count and not only 5 in 5 or 4 in 4 etc. .. <script> function handleTickInit(tick) { // update the value every 5 seconds var interval = Tick.helper.duration(5, 'seconds'); // value to add each interval var valuePerInterval = 5; // offset is a fixed date in the past var offset = Tick.helper.date('2017-03-01'); // uncomment lines below (and comment line above) if you want offset be set to the first time the user visited the page // var offset = parseInt(localStorage.getItem('tick-value-counter-offset') || Date.now(), 10); // localStorage.setItem('tick-value-counter-offset', offset); // start updating the counter each second Tick.helper.interval(function(){ // current time in milliseconds var now = Date.now(); // difference with offset time in milliseconds var diff = now - offset; // total time since offset divide by interval gives us the amount of loops since offset var loops = diff / interval; // this will make sure we only count completed loops. loops = Math.floor(loops); // multiply that by the value per interval and you have your final value tick.value = loops * valuePerInterval; }, 1000); } </script> I do not know if you understood the issue..
-
Check the error (in attach) when I send the email with image in html
-
Yes, I use my script to service for email online.. And so when I send an email to my service online I receive the email but when I send with the text include image .. I cant receive the email with the image.. I can show an example.. And when I send an attachment the link of the image or file doesn't work .. u can check in Attached..
-
Can someone help me?
-
Oh yes, of course sorry.. I can send the image in attachments, but when I want to download, the link is always wrong .. and when I put the image in the field, doesn't show nothing. Check the example with the image.. (Attach)
-
Hello mates, I'm having difficulty uploading the attachments to download the attached image or file .. the link is always incorrect. And in the message field, I am not able to make the messages appear in HTML format, for example, if you want to put an image in the message, it does not appear anything .. I have the following code $letter_html = ""; // $op_getKey = preg_match_all("/alternative; boundary=\"(.*)\"/", $email_body, $getKey); $op_getKey = preg_match_all("/boundary=\"(.*)\"/", $email_body, $getKey); $has_attachment = preg_match_all("/multipart\/mixed/", $email_body, $attachment); if ($op_getKey) { if ($has_attachment) { $mailParts = explode("--" . $getKey[1][1], $email_body); $attachParts = explode("--" . $getKey[1][0], $email_body); $get_attach_name=preg_match_all("/filename=\"(.*?)\"/", $attachParts[2], $attach_name); $get_attach_type=preg_match_all("/Content-Type: (.*?);/", $attachParts[2], $attach_type); $pure_code = explode("\n\n",$attachParts[2]); $pure_code = str_replace("\r","",$pure_code[1]); $pure_code = str_replace("\n","",$pure_code); }else{ $mailParts = explode("--" . $getKey[1][0], $email_body); } // $letter_text = str_replace('Content-Type: text/plain; charset="UTF-8"', '', $mailParts[1]); // echo $letter_text; $the_mail = $mailParts[2]; $to_replace = array( 'Content-Type: text/html; charset="UTF-8"', 'Content-Type: text/html; charset=UTF-8', 'Content-Type: text/html; charset="utf-8"', 'Content-Type: text/html; charset=utf-8', 'Content-Type: text/html; charset="iso-8859-1"', 'Content-Type: text/html; charset=iso-8859-1', 'Content-Type: text/html; charset="ISO-8859-1"', 'Content-Type: text/html; charset=ISO-8859-1', 'Content-Type: text/plain; charset="iso-8859-1"', ); foreach ($to_replace as $k => $v) { $the_mail = str_replace($to_replace[$k], '', $the_mail); } //$the_mail = str_replace('Content-Type: text/html; charset="UTF-8"', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset=UTF-8', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset="utf-8"', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset=utf-8', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset="iso-8859-1"', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset=iso-8859-1', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset="ISO-8859-1"', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset=ISO-8859-1', '', $the_mail); if (preg_match_all("/Content-Transfer-Encoding: quoted-printable/", $the_mail, $mailToDecode)) { $message_to_decode = str_replace('Content-Transfer-Encoding: quoted-printable', '', $the_mail); $letter_html = quoted_printable_decode($message_to_decode); }elseif(preg_match_all("/Content-Transfer-Encoding: base64/", $the_mail, $mailToDecode)){ $message_to_decode = str_replace('\r', '', $the_mail); $message_to_decode = str_replace('\n', '', $message_to_decode); $message_to_decode = str_replace('Content-Transfer-Encoding: base64', '', $message_to_decode); $letter_html = base64_decode($message_to_decode); // $letter_html = $message_to_decode; } else { $letter_html = $the_mail; } // echo $letter_html; } else { $mailParts = explode("\n\n", $email_body); foreach ($mailParts as $k => $v) { if ($k > 0) { $letter_html .= $v . "\n\n"; } } if(preg_match_all("/Content-Transfer-Encoding: base64/", $email_body, $mailToDecode)){ $message_to_decode = str_replace('\r', '', $letter_html); $message_to_decode = str_replace('\n', '', $message_to_decode); $letter_html = base64_decode($message_to_decode); // $letter_html = $message_to_decode; } I use the following for the Annexes <a target="_blank" href="data:<?=$attach_type[1][0]?>;base64,<?=$pure_code?>"><?=$attach_name[1][0]?></a> And I use the following for message information <?=$letter_html?> Let me see if you can help me;) Thank you, Best Regards
-
Hello mates, I'm having difficulty uploading the attachments to download the attached image or file .. the link is always incorrect. And in the message field, I am not able to make the messages appear in HTML format, for example, if you want to put an image in the message, it does not appear anything .. I have the following code $letter_html = ""; // $op_getKey = preg_match_all("/alternative; boundary=\"(.*)\"/", $email_body, $getKey); $op_getKey = preg_match_all("/boundary=\"(.*)\"/", $email_body, $getKey); $has_attachment = preg_match_all("/multipart\/mixed/", $email_body, $attachment); if ($op_getKey) { if ($has_attachment) { $mailParts = explode("--" . $getKey[1][1], $email_body); $attachParts = explode("--" . $getKey[1][0], $email_body); $get_attach_name=preg_match_all("/filename=\"(.*?)\"/", $attachParts[2], $attach_name); $get_attach_type=preg_match_all("/Content-Type: (.*?);/", $attachParts[2], $attach_type); $pure_code = explode("\n\n",$attachParts[2]); $pure_code = str_replace("\r","",$pure_code[1]); $pure_code = str_replace("\n","",$pure_code); }else{ $mailParts = explode("--" . $getKey[1][0], $email_body); } // $letter_text = str_replace('Content-Type: text/plain; charset="UTF-8"', '', $mailParts[1]); // echo $letter_text; $the_mail = $mailParts[2]; $to_replace = array( 'Content-Type: text/html; charset="UTF-8"', 'Content-Type: text/html; charset=UTF-8', 'Content-Type: text/html; charset="utf-8"', 'Content-Type: text/html; charset=utf-8', 'Content-Type: text/html; charset="iso-8859-1"', 'Content-Type: text/html; charset=iso-8859-1', 'Content-Type: text/html; charset="ISO-8859-1"', 'Content-Type: text/html; charset=ISO-8859-1', 'Content-Type: text/plain; charset="iso-8859-1"', ); foreach ($to_replace as $k => $v) { $the_mail = str_replace($to_replace[$k], '', $the_mail); } //$the_mail = str_replace('Content-Type: text/html; charset="UTF-8"', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset=UTF-8', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset="utf-8"', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset=utf-8', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset="iso-8859-1"', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset=iso-8859-1', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset="ISO-8859-1"', '', $the_mail); //$the_mail = str_replace('Content-Type: text/html; charset=ISO-8859-1', '', $the_mail); if (preg_match_all("/Content-Transfer-Encoding: quoted-printable/", $the_mail, $mailToDecode)) { $message_to_decode = str_replace('Content-Transfer-Encoding: quoted-printable', '', $the_mail); $letter_html = quoted_printable_decode($message_to_decode); }elseif(preg_match_all("/Content-Transfer-Encoding: base64/", $the_mail, $mailToDecode)){ $message_to_decode = str_replace('\r', '', $the_mail); $message_to_decode = str_replace('\n', '', $message_to_decode); $message_to_decode = str_replace('Content-Transfer-Encoding: base64', '', $message_to_decode); $letter_html = base64_decode($message_to_decode); // $letter_html = $message_to_decode; } else { $letter_html = $the_mail; } // echo $letter_html; } else { $mailParts = explode("\n\n", $email_body); foreach ($mailParts as $k => $v) { if ($k > 0) { $letter_html .= $v . "\n\n"; } } if(preg_match_all("/Content-Transfer-Encoding: base64/", $email_body, $mailToDecode)){ $message_to_decode = str_replace('\r', '', $letter_html); $message_to_decode = str_replace('\n', '', $message_to_decode); $letter_html = base64_decode($message_to_decode); // $letter_html = $message_to_decode; } I use the following for the Annexes <a target="_blank" href="data:<?=$attach_type[1][0]?>;base64,<?=$pure_code?>"><?=$attach_name[1][0]?></a> And I use the following for message information <?=$letter_html?> Let me see if you can help me;) Thank you, Best Regards