-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathphpmailer.php
More file actions
37 lines (30 loc) · 750 Bytes
/
phpmailer.php
File metadata and controls
37 lines (30 loc) · 750 Bytes
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
<?
include "config.php";
include "inc/PHPMailer_v5.1/class.phpmailer.php";
function sendMail ($frommail, $fromname, $tomail, $toname, $subject, $body, $ccmail = null, $ccname = null)
{
global $username, $password, $smtphost;
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->Host = $smtphost;
$mailer->SMTPAuth = TRUE;
$mailer->CharSet = 'utf-8';
$mailer->SetLanguage ("de");
$mailer->Username = $username;
$mailer->Password = $password;
$mailer->From = $frommail;
$mailer->FromName = $fromname;
$mailer->Body = $body;
$mailer->Subject = $subject;
$mailer->AddAddress($tomail, $toname);
if (isset ($ccmail))
{
$mailer->AddCC($ccmail, $ccname);
}
if(!$mailer->Send()) {
return false;
} else {
return true;
}
}
?>