PHP Classes

File: examples/example10_email.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Naveed ur Rehman  >  PHP Class  >  examples/example10_email.php  >  Download  
File: examples/example10_email.php
Role: Example script
Content type: text/plain
Description: Email files and folders to anyone through server
Class: PHP Class
Manage files and folders accounts
Author: By
Last change:
Date: 4 years ago
Size: 2,011 bytes


Class file image Download
                     HOW TO USE "PHP MEGAUPLOAD.COM CLASS"
 Example #10: Email files and folders to anyone through server
       Author: Naveed-ur-Rehman

require_once('../class/megaupload.class.php'); //php class file
require_once('credentials.php'); //Your signing in credentails of account

$megaupload = new megaupload_class(); //Initializing the class

$megaupload->username=$username; //Setting credentails (loaded from credentails.php)

$isconnect = $megaupload->connect(); //Return: 0=trouble, 1=validated and connected

"Credentials are verified and you are connected to successfully!<br/>";

$megaupload->refreshlist(); //Loading list is IMPORTANT!

 //Note: See example2_refreshlist.php for getting file and folder IDs

$ids = array( //You can add more files and folders

$toemail = ""; //Recepient email

$subject = "Some subject of email"; //Email subject

$message = "Some message"; //Body of email (file details will be added)

$megaupload->email($ids,$toemail,$subject,$message); //Note: There is no way to confirm success

echo "Email has been sent.";
"Error occured while connecting to May be username and/or password supplied is invalid.";

$megaupload->disconnect(); //Disconnect to release everything