summaryrefslogtreecommitdiff
path: root/upload_code.inc
diff options
context:
space:
mode:
authorprashant2015-11-04 18:10:42 +0530
committerprashant2015-11-04 18:10:42 +0530
commitbd61ca0bae497fef876a3b8c716e70919e651474 (patch)
treece2c3041afda690d0f7ea29af3e4ae9cd4925d2b /upload_code.inc
parentcf4aee0e5675851843062a070ed67b3194ddd7cf (diff)
downloadDWSIM_lab_migration_module-bd61ca0bae497fef876a3b8c716e70919e651474.tar.gz
DWSIM_lab_migration_module-bd61ca0bae497fef876a3b8c716e70919e651474.tar.bz2
DWSIM_lab_migration_module-bd61ca0bae497fef876a3b8c716e70919e651474.zip
mail function modifed and formated the code
Diffstat (limited to 'upload_code.inc')
-rwxr-xr-xupload_code.inc19
1 files changed, 14 insertions, 5 deletions
diff --git a/upload_code.inc b/upload_code.inc
index 568d1c2..c387270 100755
--- a/upload_code.inc
+++ b/upload_code.inc
@@ -350,8 +350,8 @@ function lab_migration_upload_code_form_validate($form, &$form_state)
if (isset($_FILES['files']))
{
/* check if atleast one source or result file is uploaded */
- if ( ! ($_FILES['files']['name']['sourcefile1'] || $_FILES['files']['name']['xcos1']))
- form_set_error('sourcefile1', t('Please upload atleast one main or source file or xcos file.'));
+ if ( ! ($_FILES['files']['name']['sourcefile1'] ))
+ form_set_error('sourcefile1', t('Please upload atleast one main or source file.'));
/* check for valid filename extensions */
foreach ($_FILES['files']['name'] as $file_form_name => $file_name)
@@ -580,11 +580,20 @@ function lab_migration_upload_code_form_submit($form, &$form_state) {
}
drupal_set_message('Solution uploaded successfully.', 'status');
- /* sending email */
- $email_to = $user->mail . ', ' . variable_get('lab_migration_emails', '');
+ /* sending email */
+ $email_to = $user->mail;
+
+ $from = variable_get('lab_migration_from_email', '');
+ $bcc= variable_get('lab_migration_emails', '');
+ $cc=variable_get('lab_migration_cc_emails', '');
$param['solution_uploaded']['solution_id'] = $solution_id;
$param['solution_uploaded']['user_id'] = $user->uid;
- if (!drupal_mail('lab_migration', 'solution_uploaded', $email_to, language_default(), $param, variable_get('lab_migration_from_email', NULL), TRUE))
+ $param['solution_uploaded']['headers']=array('From'=>$from,'MIME-Version'=> '1.0',
+ 'Content-Type'=> 'text/plain; charset=UTF-8; format=flowed; delsp=yes',
+ 'Content-Transfer-Encoding' => '8Bit',
+ 'X-Mailer'=> 'Drupal','Cc' => $cc, 'Bcc' => $bcc);
+
+ if (!drupal_mail('lab_migration', 'solution_uploaded', $email_to, language_default(), $param, $from, TRUE))
drupal_set_message('Error sending email message.', 'error');
drupal_goto('lab-migration/code');