$notification_to = $member_id;
            $notification_by = $general_user;
            $notification_status = 'unread';
            $dtime = date('Y-m-d h:i:s');
            $qryAddNotification = mysqli_query($bd, "INSERT INTO notification(msg, notification_to, notification_by, dtime, status) VALUES('{$notification}', '{$notification_to}', '{$notification_by}', '{$dtime}', '{$notification_status}')");
            header('location:mygroup.php?group=' . $group_id . '&invite=srinvited');
        } else {
            // Member Not Exist
            $dtime = date('Y-m-d h:i:s');
            $ucode = $general_user . "" . date('Ymdhis');
            $qryAddNotification = mysqli_query($bd, "INSERT INTO nm_invite(first_name, last_name, email, invite_by, invited_group, dtime, status, ucode) VALUES('{$member_fname}', '{$member_lname}', '{$member_email}', '{$general_user}', '{$group_id} ', '{$dtime}', 'invite', '{$ucode}')");
            $email_subject = $group_name . " group invitation - Village Experts";
            $email_message = "You are invited to '" . $group_name . "' group on https://www.villageexperts.com/ . Please click the button below to complete your registration and join the group. <a href='http://www.villageexperts.com/nm_register_page.php?ucode=" . $ucode . "' style='float:left;width:100%;padding: 10px 0;background:#1274C0;color:#fff;text-align:center;text-decoration: none;font-size: 26px;margin-top: 20px;'>Complete Your Registration</a>";
            //mail($member_email,$email_subject,$email_message);
            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            amazonSesEmail('*****@*****.**', $email_subject, $email_message);
            /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            header('location:mygroup.php?group=' . $group_id . '&invite=nminvited');
            exit;
        }
    }
} else {
    header('location:mygroup.php?group=' . $group_id . '&error=noemail');
    exit;
}
function amazonSesEmail($to, $subject, $message)
{
    $amazonSes = new AmazonSES(array('key' => 'AKIAIMT5T3NIZUY2PKYQ', 'secret' => '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'));
    //$amazonSes->verify_email_address('*****@*****.**');
    $response = $amazonSes->send_email('*****@*****.**', array('ToAddresses' => array($to)), array('Subject.Data' => $subject, 'Body.Html.Data' => $message));
    if (!$response->isOK()) {
Exemplo n.º 2
0
<?php

ini_set('display_errors', '1');
require 'AWSSDKforPHP/sdk.class.php';
function amazonSesEmail($to, $subject, $message)
{
    $amazonSes = new AmazonSES(array('key' => 'AKIAIMT5T3NIZUY2PKYQ', 'secret' => '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'));
    //$amazonSes->verify_email_address('*****@*****.**');
    $response = $amazonSes->send_email('*****@*****.**', array('ToAddresses' => array($to)), array('Subject.Data' => $subject, 'Body.Text.Data' => $message));
    if (!$response->isOK()) {
        echo "BAD";
    } else {
        echo "GOOD";
    }
}
amazonSesEmail('*****@*****.**', 'test email aws', 'Agar tum sath ho');