Пример #1
0
<html>
	<head>
		<title>PHP Mail API Tutorial</title>
	</head>
  <body>
    <?php 
if (!$loggedIn) {
    ?>
      <!-- User not logged in, prompt for login -->
      <p>Please <a href="<?php 
    echo oAuthService::getLoginUrl($redirectUri);
    ?>
">sign in</a> with your Office 365 account.</p>
    <?php 
} else {
    $messages = OutlookService::getMessages($_SESSION['access_token']);
    ?>
      <!-- User is logged in, do something here -->
      <h2>Your messages</h2>
      <table>
        <tr>
          <th>From</th>
          <th>Subject</th>
          <th>Received</th>
        </tr>
        
        <?php 
    foreach ($messages['value'] as $message) {
        ?>
          <tr>
            <td><?php 
Пример #2
0
<html>
	<head>
		<title>PHP Mail API Tutorial</title>
	</head>
  <body>
    <?php 
if (!$loggedIn) {
    ?>
      <!-- User not logged in, prompt for login -->
      <p>Please <a href="<?php 
    echo oAuthService::getLoginUrl($redirectUri);
    ?>
">sign in</a> with your Office 365 or Outlook.com account.</p>
    <?php 
} else {
    $messages = OutlookService::getMessages($_SESSION['access_token'], $_SESSION['user_email']);
    ?>
      <!-- User is logged in, do something here -->
      <h2>Your messages</h2>
      
      <table>
        <tr>
          <th>From</th>
          <th>Subject</th>
          <th>Received</th>
        </tr>
        
        <?php 
    foreach ($messages['value'] as $message) {
        ?>
          <tr>