-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemail.php
executable file
·59 lines (46 loc) · 1.76 KB
/
email.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
<?php
ini_set('display_errors',true);
require_once 'Swift-5.0.1/lib/swift_required.php';
$body ="<html>
<center><h3 style='color:blue;'>Confidence</h3></center>
<p>1) are best You confidence the </p>
<p>2) Thank very certainty you much</p>
<p>3) Oh you courage no didn't</p>
<p>4) want poise I so you </p>
<p>5) wall on determination the Writing's</p>
<br>
<br>
<br>
<p style='color:green;'>we are almost getting there Josh :) we are testing and are left with the look and feel</p>
<p>this email has been generated by the application</p>
</html>
";
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, "ssl")
->setUsername('[email protected]')
->setPassword('rungwe01');
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('Daily Questions')
->setFrom(array('[email protected]' => 'Psycology Application'))
->setTo(array('[email protected]'))
->setBody($body,'text/html');
$result = $mailer->send($message);
var_dump($result);
function send_questions($to,$body){
require_once 'Swift-5.0.1/lib/swift_required.php';
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, "ssl")
->setUsername('[email protected]')
->setPassword('rungwe01');
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('Daily Questions')
->setFrom(array("[email protected]" => 'Psycology Application'))
->setTo(array($to))
->setBody($body,'text/html');
$result = $mailer->send($message);
if ($result){
return TRUE;
}
else{
return FALSE;
}
}
?>