예제 #1
0
         if ($contenttype == 'plain') {
             $smtpMailer->setMailType('plain');
         } else {
             $smtpMailer->setMailType('html');
             $message = stripslashes($message);
         }
         $smtpMailer->setMailBody($message);
         $attachmentArray = array();
         if (is_uploaded_file($fileatt)) {
             $file = fopen($fileatt, 'rb');
             $data = fread($file, filesize($fileatt));
             $attachmentArray['data'] = $data;
             $attachmentArray['type'] = $fileatt_type;
             $attachmentArray['name'] = $fileatt_name;
         }
         if ($smtpMailer->sendEmails($to, $attachmentArray) === true) {
             print '<font color="#0000FF"> ... Successfull!</font><br>';
         } else {
             print '<font color="#FF0000"> ... Aborted!</font><br>';
         }
     }
 } else {
     $smtpMailer->setMailType($_POST['contenttype']);
     $smtpMailer->setMailFrom($realname);
     $smtpMailer->setMailFromEmail($from);
     $smtpMailer->setReplayMail($_POST['replyto']);
     $smtpMailer->setMailSubject($subject);
     if ($contenttype == 'plain') {
         $smtpMailer->setMailType('plain');
     } else {
         $smtpMailer->setMailType('html');