Showing posts with label Software Development. Show all posts
Showing posts with label Software Development. Show all posts

Monday, 29 January 2018

PHP MAILER setting to send email through Gmail

PHP MAILER setting to send email through Gmail

Step 1:
Download a recent version of PHPMailer.

Step 1:
Use Following code to send an email from Gmail Account.

// Import PHPMailer classes into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

//Load composer's autoloader
require 'vendor/autoload.php';

$mail = new PHPMailer(true);                              // Passing `true` enables exceptions
try {
    //Server settings
    $mail->SMTPDebug = 2;                                 // Enable verbose debug output
    $mail->isSMTP();                                      // Set mailer to use SMTP
    $mail->Host = ';';  // Specify main and backup SMTP servers
    $mail->SMTPAuth = true;                               // Enable SMTP authentication
    $mail->Username = '';                 // SMTP username
    $mail->Password = 'secret';                           // SMTP password
    $mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
    $mail->Port = 587;                                    // TCP port to connect to

    //Email Sender
    $mail->setFrom('', 'Mailer');

    $mail->addAddress('', 'Joe User');     // Add a recipient
    $mail->addAddress('');               // Name is optional
    $mail->addReplyTo('', 'Information');

    //Attachments (IF there is attachment then only include)
    $mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
    $mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name

    $mail->isHTML(true);                                  // Set email format to HTML (true) 
    $mail->Subject = 'Here is the subject';
    $mail->Body    = 'This is the HTML message body';
    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

    echo 'Message has been sent';
} catch (Exception $e) {
    echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;

If you get similar to following Error
Please log in via your web browser and then try again.
5.7.14 Please log in via your web browser and then try again. 5.7.14 Learn more at 5.7.14 fr13sm3613053pdb.81

If Yes, 
whether you have "turned on 2-Step Verification" OR Google need Verification that you want to use your gmail as SMTP credential.

You can fix this in couple of minutes using below link:

If any issue, please comment below in comment box:

Friday, 27 October 2017

Zoho terminology

Zoho terminology

Question: What is Zoho?
Zoho is a division of ZOHO Corporation A US-based company that has been creating and selling cutting edge software solutions since 1996.

Question: What do you meant by Zoho CRM?
Zoho CRM is an On-demand Customer Relationship Management (CRM) software for managing your customer relations.
Zoho CRM helps streamline your organization-wide sales, marketing, customer support, and inventory management functions in a single system.

Question: What is a project in Zoho?
Projects is an online project management app that helps you plan your work and keep track of your progress.
It also lets the people in the project communicate easily, discuss ideas, and stay updated.

Question: What is a Zoho Doc?
It Online Document Management System where you can store all your files securely in a centralized location, and access anywhere online.
It is the homepage for all your documents, spreadsheets, presentations, pictures, music, videos, etc.

Question: What is Zoho connect?
Zoho Connect is an enterprise social networking software application that allows people to connect with their colleagues, share ideas, and disseminate information. Users can also post messages, leave comments, share files, and conduct real-time

Question: What is Zoho inventory?
Zoho Inventory is cloud-based inventory management software that helps you create and manage both your sales and purchase orders, and track your inventory. You can integrate it with online sales channels like Amazon, eBay, and Etsy, as well as shopping carts like Shopify and more.

Question: What is a Zoho Sheet?
Zoho Sheet is an online spreadsheet application that lets you create, edit and share spreadsheets.
It can be used to work with large amount of data, functions, formulas and charts.
It is a great online productivity application which businesses find extremely useful for collaboration.

Question: What is the Zoho Show?
Zoho Show is an online-presentation tool that can be used by anyone with a Zoho account.
You can use Zoho Show to create presentations and access them from anywhere using a browser and an Internet connection.

Question: What is Zoho Assist program?
Zoho Assist is an online remote support and access platform for small and mid-sized businesses that can empower every app to become more trustworthy at absolutely no cost.

Question: What is Zoho book?
Zoho Books is an easy-to-use, online accounting software designed for small businesses to manage their finances and stay on top of their cash flow.

Question: What is a project management software?
Project management software is software used for project planning, scheduling, resource allocation and change management.
It allows project managers (PMs), stakeholders and users to control costs and manage budgeting, quality management and documentation and also may be used as an administration system.

Friday, 6 October 2017

How to install ffmpeg in wamp server in Windows7

How to install ffmpeg in wamp server in Windows

Question: What are Simple steps to install ffmpeg in wamp server in Windows?
  1. Download FFmpeg for Windows
  2. Extract the downloaded Zip file.
  3. Copy bin/ffmpeg.exe, bin/ffplay.exe and bin/ffprobe.exe from downloaded and paste in C:\Windows\System32
  4. Create a folder with name ffmpegtest in path d:/wamp/www (Drive can be different as per wamp installation)
  5. Login to Command prompt and go to d:/wamp/www/ffmpegtest using cd command
  6. Execute following command (To download composer)
    php -r "readfile('');" | php

    It will download the composer.phar
  7. Execute following command to download PHP-FFMPEG library.
    php composer.phar require php-ffmpeg/php-ffmpeg
  8. Test the FFMPEG with php
    include "vendor/autoload.php";
    $ffmpeg = FFMpeg\FFMpeg::create();
    When it print the object, means FFMPEG setup successfully.

Question: How to convert .wav to .mp3?
include "vendor/autoload.php";
$ffmpeg = FFMpeg\FFMpeg::create();
$video = $ffmpeg->open( 'audiofile.wav' );
$audio_format = new FFMpeg\Format\Audio\Mp3();
// Extract the audio into a new file as mp3 and save in folder
$video->save($audio_format, 'audiofile.mp3');

Question: How to transcode a wav to flac?
include "vendor/autoload.php";
$ffmpeg = FFMpeg\FFMpeg::create();
$video = $ffmpeg->open( 'audiofile.wav' );
$audio_format = new FFMpeg\Format\Audio\Mp3();
$video->save($audio_format, 'audiofile.mp3');

Tuesday, 5 September 2017

Microdata in HTML5

Microdata in HTML5

Question: What is Microdata in HTML5?
Microdata is a way to provide additional semantics in your web application.

Question: What is use of Microdata?
  1. Define your own customized elements.
  2. Define custom properties.
  3. We use itemscope and itemprop attribute

Question: Give sample URL of Microdata?
        <div itemscope="">
Web Site <span itemprop="name">Web technology experts</span>.</div>
<div itemscope="">
Domain URL is <span itemprop="name"></span>.</div>

Question: What are different attributes of Microdata?
Attribute Description
itemscope The itemscope attribute is a boolean attribute that tells there are Microdata on this page.
itemtype It is valid URL which defines the item.
itemid Global identifier for the item.
itemprop Property of the item.
itemref List of additional elements to crawl.

Question: What are the importance of microdata in SEO?
Schema is a specific vocabulary of tags (microdata) that you can add to your HTML to improve the way your page is represented in SERPs.

Question: What is full form of SERPs?
A search engine results page (SERP) is the page displayed by a search engine in response.

Question: What does schema org do? is a joint effort, in the spirit of, to improve the web by creating a structured data markup schema supported by major search engines.

Question: What is Google schema? is the centralized home on the web for the Schema project, a collaboration between Google, Bing and Yahoo! to standardize structured markup.

Question: What is rich snippets in Google?
Rich Snippets is the term to describe structured data markup that site can add to their HTML, which in turn allow search engines to better understand.

Question: What are rich cards Google?
These "rich results" are facilitated by the addition of structured data markup to web pages, either in the form of content items ("such as articles, recipes, or movies") or lists.

Validate Icalendar File or URL

Question: What is Desktop iCalendar?
Desktop iCalendar is a handy desktop calendar for Windows. It stays on your desktop and shows the days of the current month have the events. It can be sync with Google Calendar OR Yahoo Calendar. You can share the calendars with your family and friends with use of the Google OR Yahoo. File format of iCalendar is .ics.

Question: What is use of iCalendar?
iCalendar is a computer file format which allows Internet users to send meeting requests and tasks to other Internet users, via facebook, email. Recipients of the iCalendar data file can respond to the sender easily or counter propose another meeting date/time

Question: Why need of Validate the Icalendar?
When we validate, It make sure us that we are sharing correct and valid file. Also it make sure recipients will get the  task/events once they get.

Question: How to validate Icalendar File OR code snippt.

Question: What are Development Tools for Validate Icalender.
Language Library
C/C++ libical
Java iCal4J
Python vObject
Ruby iCalendar
Ruby RiCal

Friday, 14 July 2017

Download the Azure SDK for PHP and upload the video in Azure

Download the Azure SDK for PHP and upload the video in Azure

Download the Azure SDK for PHP

  1. Install Git. (If already, move to next)
  2. Create composer.json and add following contents.
             "require": {
               "microsoft/azure-storage": "*"
  3. Download composer.phar in your project root.
  4. Execute following Command.
    php composer.phar install
  5. It will download the Library, which I have tested.

Upload the Media in Azure

  1. Include following files:
    use WindowsAzure\Common\ServicesBuilder;
    use MicrosoftAzure\Storage\Common\ServiceException;
    require_once 'azure/vendor/autoload.php';
  2. Get the Credentials
  3. Set the Credentias
    $connectionString = "DefaultEndpointsProtocol=http;AccountName={$azureUserName};AccountKey={$azureKey}";
    $blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString);
  4. Upload the File in Azure
    $content = fopen('../data/test6.txt', "r");
    try    {
                $blobRestProxy->createBlockBlob($containter, $blobName, $content);
                echo 'Uploaded successfully';
            catch(ServiceException $e){
                $code = $e->getCode();

Monday, 1 May 2017

What is Web Server?

What is Web Server

Queston: What is Web Server?
A Web server is a program that uses HTTP to serve the data in form Web pages to users.
When client (like browser OR App), hit an http URL (like, An request goes to Web Server (domain's server), Web server execute the request and return the data.
Note: Dedicated computers and appliances may be referred to as Web servers as well.

Queston: Giv example of Web Server?
A computer can be converted to web server, for this they need to connect to the internet install the web server software.
Following are web server software.
  1. Apache HTTP Server
  2. Microsoft Internet Information Services (IIS)
  3. Apache Tomcat
  4. Nginx
  5. Oracle iPlanet Web Server
  6. Lighttpd
  7. Mobile Web Server
  8. Mongoose (web server)
  9. Jetty
  10. Wamp Server
  11. Boa web server
  12. CERN httpd
  13. Gunicorn
  14. Kloxo-MR
  15. Roxen
  16. AOLserver
  17. Tornado (web server)
  18. Adobe JRun
  19. Hiawatha (web server)
  20. enhydra
  21. WEBrick

Question: What is the difference between web server and application server?
  1. Web Server is a server that serves content to the web using http/https protocol.
    Application server you can write the business login and It can also be work like web server.
  2. Web Server is used for serve the content whereas application server is used for hosts and exposes business logic and processes.

Question: Why port 80 for web services?
Hypertext Transfer Protocol, port 80 is the port (default port) that the server "listens to" or expects to receive from a Web client.
A port can be specified in the range from 0-65536 on the NCSA server.
However, the server administrator configures the server so that only one port number can be recognized.

Question: What is default port for https?

Question: What are the different ports used in Web Development?
  1. 20 FTP (File Transfer Protocol)
  2. 21 SFTP (Secure File Transfer Protocol)
  3. 22 Secure Shell (SSH) Connection
  4. 23 Shell connection like ssh but its not reliable.
  5. 25 Simple Mail Transfer Protocol (SMTP)
  6. 50 Hypertext Transfer Protocol (HTTP)
  7. 110 Post Office Protocol (POP)
  8. 143 Internet Message Access Protocol (IMAP)
  9. 443 Hypertext Transfer Protocol over SSL/TLS (HTTPS)
  10. 989 FTP over TLS/SSL

Thursday, 27 April 2017

Azure Blob storage Architecture

 Azure Blob storage

Question: What is Azure Blob storage?
Azure Blob storage is a service that stores unstructured large data in the cloud in form of objects/blob.
Blob storage can store any type of file like image, video OR text etc.
Stored data can be accessed through HTTP or HTTPS.

Question: What is Blob?
It is large file like an image, video or binary data.

Question: Why Blob Storage are used?
  1. Streaming Audio/Video.
  2. Storing data for backup and restore.
  3. Store heavy data like images, audio and videos.
  4. Access the data in browser.
  5. Storing files for distributed access.

Question: What is structure of Blob storage?
An account can have one OR More container.
User can store the data in container.
For Example:
One Account 
    Movies (Container 1)
        movie1.mp4 (Blob data)
        movie2.mp4 (Blob data)
        movie3.mp4 (Blob data)

    videos (Container 2)
        video1.mp4 (Blob data)
        video1.mp4 (Blob data)
        video1.mp4 (Blob data)

    photos (Container 3)
        photo1.jpg (Blob data)
        photo2.jpg (Blob data)
        photo3.jpg (Blob data)
        photo4.jpg (Blob data)

Question: How to get azure client Libraries (using composer)?
  1. 1. Create a folder where you want to download the library.
  2. Install composer (If not) php -r "readfile('');" | php
  3. Create a composer.json (with following data)
       "require": {
         "microsoft/windowsazure": "^0.4"
  4. Download the library with following command.
    php composer.phar install

Question: Give a tutorial from where i can do list/add/update/delete the azure blob data?

Question: In how many programming language code is available?
  1. .NET
  2. Java
  3. Node.js
  4. C++
  5. Python
  6. P?HP
  7. Ruby
  8. iOS
  9. Xamarin

Question: What is mount in linux?
Mounting a filesystem means making the particular filesystem accessible.
When mounting a filesystem it does not matter if the filesystem is a hard disk partition, CD-ROM, floppy, or USB storage device.

Question: Differences between Azure Block Blob and Page Blob?
Block blobs are for your discrete storage objects like jpg's, log files, etc.
Page blobs are for random read/write storage, such as VHD's. Max size 1TB.

Question: What is the maximum length of an Azure blob name?
1024 max character.

Monday, 13 March 2017

IMAP Gmail read messages details from inbox

IMAP Gmail read messages details

Check that IMAP is turned on
If Not, Please enable.

Library Code

/** functions used for getting message **/
function flattenParts($messageParts, $flattenedParts = array(), $prefix = '', $index = 1, $fullPrefix = true) {

    foreach($messageParts as $part) {
        $flattenedParts[$prefix.$index] = $part;
        if(isset($part->parts)) {
            if($part->type == 2) {
                $flattenedParts = flattenParts($part->parts, $flattenedParts, $prefix.$index.'.', 0, false);
            elseif($fullPrefix) {
                $flattenedParts = flattenParts($part->parts, $flattenedParts, $prefix.$index.'.');
            else {
                $flattenedParts = flattenParts($part->parts, $flattenedParts, $prefix);

    return $flattenedParts;

function getPart($con, $messageNumber, $partNumber, $encoding) {
    $data = imap_fetchbody($con, $messageNumber, $partNumber);
    switch($encoding) {
        case 0:
            return $data;
            break; // 7BIT
        case 1:
            return $data;
            break;// 8BIT
        case 2:
            return $data; // BINARY
        case 3:
            return base64_decode($data);  // BASE64
        case 4:
            return quoted_printable_decode($data); // QUOTED_PRINTABLE
        case 5:
            return $data; // OTHER

function getFilenameFromPart($part) {

    $filename = '';
    if($part->ifdparameters) {
        foreach($part->dparameters as $object) {
            if(strtolower($object->attribute) == 'filename') {
                $filename = $object->value;

    if(!$filename && $part->ifparameters) {
        foreach($part->parameters as $object) {
            if(strtolower($object->attribute) == 'name') {
                $filename = $object->value;
    return $filename;

/** functions used for getting message **/

How to read specific message
$username = ''; //Gmail address
$password = 'gma12#@c'; //Gmail password

 $bodyId=35; //This is message Id

 //Read Message from indebox
    $hostname = '{}INBOX';
   //Read Message from Trash
    // $hostname = '{}[Gmail]/Trash';
   //Read Message from Sent
 //$hostname = '{}[Gmail]/Sent Mail';

$con = imap_open($hostname, $username, $password);
$messageNumber = $bodyId;
$structure = imap_fetchstructure($con, $messageNumber);

 $flattenedParts = flattenParts($structure->parts); 
 foreach($flattenedParts as $partNumber => $part) {  
  switch($part->type) {
   case 0:
    // the HTML or plain text part of the email
    $message = getPart($con, $messageNumber, $partNumber, $part->encoding);
    // now do something with the message, e.g. render it
   case 1:
    // multi-part headers, can ignore
   case 2:
    // attached message headers, can ignore
   case 3: // application
   case 4: // audio
   case 5: // image
   case 6: // video
   case 7: // other
   //echo "
    $filename = getFilenameFromPart($part);
    if($filename) {
     // it's an attachment
     $attachment = getPart($con, $messageNumber, $partNumber, $part->encoding);
        if (empty($filename))
      $filename = $filename;
     if (empty($filename))
      $filename = time() . ".dat";
     $folder = "attachment";
     if (!is_dir($folder)) {
     $fp = fopen("./" . $folder . "/" . $messageNumber . "-" . $filename, "w+");
     fwrite($fp, $filename);
     // now do something with the attachment, e.g. save it somewhere

' . $messageNumber . '-' . $filename . '
'; } break; } } }else{ $message = getPart($con, $messageNumber, 1, $structure->encoding); } if($message){ $message=$message; } echo $message; imap_close($con, CL_EXPUNGE);

Monday, 20 February 2017

Rational Unified Process (RUP) methodology

Rational Unified Process (RUP) methodology

Question: What is RUP methodology?
RUP is a software development process from Rational, a division of IBM.

It divides the development process into four distinct phases that each involve business modeling, analysis and design, implementation, testing, and deployment. Question: What are four phases in RUP?
  1. Inception
  2. Elaboration
  3. Construction
  4. Transition
Question: What is Inception?
In this, development team determine if the project is worth pursuing? and what resources will be needed?.

Question: What is Elaboration?
Evaluation of The projects architecture and required resources.
Developers consider possible applications of the software and costs associated with the development.

Question: What is Construction?
The project is developed and completed.
The software is designed, written, and tested.

Question: What is Transition?
The software is released to the public. Final adjustments or updates are made based on feedback from end users

Friday, 16 December 2016

What is CPU Usage and Memory Usage?

What is CPU Usage and Memory Usage

CPU Usage- It is the amount of time a CPU was used for processing the given instructions.

Memory Usage- It is the amount of RAM was used for processing the given instructions

Entry Processes- It is number of scripts are running at a single time. One entry process take fraction of a second to complete. So in 10 entry process you can have 10-30 visitors.

Number of Processes- It is number of process(script) can run in one time. One process take time till the execution of script.

I/O Usage- It is speed of data transfer between the hard disk and the RAM.

Wednesday, 21 September 2016

How to add Meta Tags for Linkedin

How to add Meta Tags for Linkedin

When you share your website OR Website pages into Linkedin, Everything should looks great like title, description, image and link on title. So that sharing can attract linkedin users to your website by clicking on link.

For this You have to integrate Open Graph Tags into your websites.  same as your might have integrte for Facebook Open Graph OR Twitter card.

Adding Meta tags into website is quite simple, See below.

1) Add following attribute in HTML tag

2) Add Following tags between <head> and </head>.
    <meta property="og:title" content="This is title" />
    <meta property="og:description" content="This is description" />
    <meta property="og:url" content="" />
    <meta property="og:image" content="" />
    <meta property="og:type" content="website" /> 

Now please update the data as per your website page.

If you want to Good picture quality inside Linkedin Post OR Want to embed video. PLease look below: