-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.php
119 lines (116 loc) · 5.69 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
//////////// To run from the shell uncomment the line below
//#!/usr/bin/php -q
<?php
/*
* The $message variable must ONLY be html that appears after the <body>
* There is no need for ANY HTML before or including <body> or after or including </body>
* We handle the headers so that the email format is perfect
* <html><head>
* <title>
* $subject
* </title>
* </head><body>
* $message
* </body></html>
*
****IMAGES******
****IMPORTANT*****
* to use images in the HTML simply reference them from the eDM account
* account URL: https://youraccount.au.zuluedm.com/
* username = ttttttt
* p/w = tttttttt
*
* for example <img src="https://youraccount.au.zuluedm.com/media/images_new/logo.jpg" .....>
* Images & Files are under the content menu item. After uploading right click the image to access the URL
*
*************
*EMAIL *********
* note the from email must be youraccount.net so we have preset this as info@youraccount.net
* and the email from name is preset to Your Account - base64 encode this is you change this to a variable
* we have not included variables here - you can create another function or adjust the one below
*/
include 'httpful.phar';
function send_emails($email_to,$email_to_name,$subject,$message)
{
$email_from_name = base64_encode('Enter From Name');
$email_from = 'info@youraccount.net';
$email_to_name = base64_encode($email_to_name);
$subject = base64_encode($subject);
$message = urlencode($message);
$uri = "https://youraccount.au.zuluedm.com/api/rest/zulusmtp/?data[zflag]=external&data[ztoemail]=" . $email_to . "&data[ztoname]=" . $email_to_name . "&data[zsubject]=" . $subject . "&data[zfromemail]=" . $email_from . "&data[zfromnanme]=" . $email_from_name . "&data[ztemplatehtml]=" . $message;
echo $uri;
$response = \Httpful\Request::get($uri)
->addHeader('Accept', '/')
->addHeader('X-API-KEY', 'xxxxx') //get these details from your account
->addHeader('X-API-Username', 'xxxx')
->addHeader('X-API-Password', 'xxxx')
->send();
}
$subjecttest = 'Your Data Protect 360 domain can now be secured';
$emailtemplate = '<table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" class="background">
<tr>
<td align="center" valign="top" width="100%" class="background">
<center>
<table cellpadding="0" cellspacing="0" width="600" class="wrap">
<tr>
<td valign="top" class="wrap-cell" style="padding-top:30px; padding-bottom:30px;">
<table cellpadding="0" cellspacing="0" class="force-full-width">
<tr>
<td height="60" valign="top" class="header-cell">
<img style="margin:auto;" width="445" height="89" src="https://youraccount.au.zuluedm.com/media/images_new/logo.jpg" alt="logo">
</td>
</tr>
<tr>
<td valign="top" class="body-cell">
<table cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
<tr>
<td valign="top" style="padding-bottom:15px; background-color:#ffffff;">
<h1>Welcome to Your Account</h1>
</td>
</tr>
<tr>
<td valign="top" style="padding-bottom:20px; background-color:#ffffff;">
<b>Hi</b><br>
We\'re really excited that "youraccount" has now joined the Zulu eDM email sending network! You\'re eDM account and email gateway link is below.<br>
<br>
This is an email generated by the function we wrote for your team to use our compliant email API. The email has
<br> been generated from your AWS server. As you using Zulu eDM you can move youraccount.net to a Trusted Sender Score of 7++. Tom David will be in touch.
</td>
</tr>
<tr>
<td>
<table cellspacing="0" cellpadding="0" width="100%" bgcolor="#ffffff">
<tr>
<td style="width:200px;background:#008000;">
<div>
<a href="https://youraccount.au.zuluedm.com" style="background-color:#008000;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:18px;line-height:40px;text-align:center;text-decor$
</div>
</td>
<td width="360" style="background-color:#ffffff; font-size:0; line-height:0;"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="padding-top:20px;background-color:#ffffff;">
Thank you,<br>
Your Zulu eDM Email Delivery and Cyber Email Security Team
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" class="footer-cell">
Trusted Sender Network
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>';
send_emails('test@youraccount.net','Recipient Name Here', $subjecttest, $emailtemplate);