Send Mail without a file attachment
This commit is contained in:
parent
bc9f84a64c
commit
cef1650686
4 changed files with 21 additions and 3 deletions
|
@ -21,6 +21,12 @@ function main($ini) {
|
|||
|
||||
$filename = $data["filename"];
|
||||
|
||||
$nofile = $data["nofile"];
|
||||
|
||||
if ($nofile) {
|
||||
$filename = "";
|
||||
}
|
||||
|
||||
foreach ($addresses as $address) {
|
||||
if (sendMail($title, $content, $filename, $address, $ini) != 0) {
|
||||
print "-1";
|
||||
|
@ -46,7 +52,9 @@ function sendMail($title, $content, $filename, $address, $ini) {
|
|||
$mail->addReplyTo($ini["reply"]);
|
||||
}
|
||||
|
||||
$mail->AddAttachment("../../assets/file.bin", $filename);
|
||||
if (!empty($filename)) {
|
||||
$mail->AddAttachment("../../assets/file.bin", $filename);
|
||||
}
|
||||
|
||||
if (!$mail->Send()) {
|
||||
return -1;
|
||||
|
|
Reference in a new issue