View difference between Paste ID: F1pBitpE and zHBvNat8
SHOW: | | - or go back to the newest paste.
1
<?php
2
3
// easymail php api
4
5
$username = "sharon";
6
$password = EasyMaill::getPassword($_POST);
7
EasyMail::authenticate($username, $password);
8
9-
EasyMail::sendMail("bobby@businessname", "Subject", "The message should be put here. Use HTML where possible.");
9+
EasyMail::sendMail("bobby@businessname", "Subject", "The message should be put here. Use HTML where possible.");
10
11
// using the API, you can create a new group
12
13
$group = EasyMail::addGroup("businessname"); // must be authenticated. returns the group's name
14
15
// you can add users to groups
16
17
EasyMail::addUser("username", "password", $group);
18
19
// removing a user from a group must be done from the website due to the need to download emails
20
21
// checking email is simple
22
23
$unread = EasyMail::unreadCount("All"); // you can check how many unread emails you have
24
25
foreach(EasyMail::checkMail("Inbox") as $email){
26
     // the checkMail WILL NOT read the email. It will provide basic information
27
28
     echo $email['sender'] . " sent you an email " . $email['readableTimestamp'] . " (E-Mail ID: " . $email['emailID'] . ")";
29
}
30
31
// If you know the ID of an email, it can be read provided the authenticated user's address matches the recipient address
32
33
EasyMail::readMail(1238832910);