emailLink.php
2.3 KB
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
<?php
/**
* emailLink.php
*
* Creates the form and functionaility for emailing a link to some1
*
*
* @author Mukhtar Dharsey
* @date 22 January 2003
*/
require_once("../../../../config/dmsDefaults.php");
global $default;
require_once("$default->fileSystemRoot/lib/email/Email.inc");
if(checkSession())
{
// include the page template (with navbar)
require_once("$default->fileSystemRoot/presentation/webPageTemplate.inc");
// when email button sent..send email
if ($submit)
{
//set up body and link
$body = "<b> Here's a interesting link: </b>";
$docID = $fDocumentID;
//link has to be changed to respective server where everything is stored.
$link = $default->owl_url . "control.php?action=viewDocument&fDocumentID=" . $docID;
$hyperlink = "<a href = ". $link .">" . $link. "</a>";
//create email object
$emailLink= new Email();
//send email
$success = $emailLink->sendHyperLink($fromEmail,$fromName,$toEmail,$subject,$body, $hyperlink);
//if successful ..rerender the page
if($success == True)
{
$Center = "<br>Email Successfully Sent</br>";
$oPatternCustom = & new PatternCustom();
$oPatternCustom->setHtml($Center);
$main->setCentralPayload($oPatternCustom);
$main->render();
}
Else
{
$Center = "<br>Email Unsuccessful</br>";
$oPatternCustom = & new PatternCustom();
$oPatternCustom->setHtml($Center);
$main->setCentralPayload($oPatternCustom);
$main->render();
}
}
//create the necessary HTML for the emailing
$Center = "
<br>
</br>
<TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\">
<tr>
<td>To Email: <TD WIDTH=\"100%\"><INPUT type=\"Text\" name=\"toEmail\" size=\"30\"></td></td>
</tr>
<tr>
<td>Your Name: <TD WIDTH=\"80%\"><INPUT type=\"Text\" name=\"fromName\" size=\"30\"></td></td>
</tr>
<tr>
<td>Your Email: <TD WIDTH=\"80%\"><INPUT type=\"Text\" name=\"fromEmail\" size=\"30\"></td></td>
</tr>
<tr>
<td>Subject: <TD WIDTH=\"80%\"><INPUT type=\"Text\" name=\"subject\" size=\"30\"></td></td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td><center><TD WIDTH=\"80%\"><INPUT type=\"Submit\" name=\"submit\" value=\"Send Email\"></center></td></td>
</tr>
</table>
";
$oPatternCustom = & new PatternCustom();
$oPatternCustom->setHtml($Center);
$main->setCentralPayload($oPatternCustom);
$main->setFormAction($_SERVER["PHP_SELF"]);
$main->render();
}
?>