<!--Code snippets for Reducing of image size--> <?php header('Content-Type: image/jpeg'); function compress_image($source_url, $destination_url, $quality) { $info = getimagesize($source_url); if ($info['mime'] == 'image/jpeg') $image = imagecreatefromjpeg($source_url); elseif ($info['mime'] == 'image/gif') $image = imagecreatefromgif($source_url); elseif ($info['mime'] == 'image/png') $image = imagecreatefrompng($source_url); //save it var_dump($destination_url); header('Content-Type: image/jpeg'); imagejpeg($image, $destination_url, $quality); //return destination file url return $destination_url; } $source_photo = 'http://localhost/test/uploads/image2.jpg'; $dest_photo = $_SERVER['DOCUMENT_ROOT'].'/test/uploads/image5.jpg'; $d = compress_image($source_photo, $dest_photo, 80); ?>
PHP mail function and mail configuration in XAMPP and sending mail is done from sendmail through localhost. I hope it will help you. mail() function <? php $to = 'dubeynitish22@hotmail.com' ; $subject = 'Test' ; $message = 'Hello' ; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion (); if (! mail ( $to , $subject , $message , $headers )){ echo "Error !!" ; } else { echo "Email Sent !!" ; } ?> 2. php.ini configuration (For SEND-MAIL) [ mail function ] ; For Win32 only . ; http : //php.net/smtp ; SMTP = localhost ; http : //php.net/smtp-port ; smtp_port = 25 ; For Win32 only . ; http : //php.net/sendmail-from ; sendmail_from = me@example . com ; For Unix only . You may supply arguments as well ( default : "sendmail -t -i&q
good nitish
ReplyDeleteThanks !!
Delete