Line 118... |
Line 118... |
118 |
$mail->Host = $config['smtp_host'];
|
118 |
$mail->Host = $config['smtp_host'];
|
119 |
$mail->SMTPAuth = true;
|
119 |
$mail->SMTPAuth = true;
|
120 |
$mail->Username = $config['smtp_username'];
|
120 |
$mail->Username = $config['smtp_username'];
|
121 |
$mail->Password = $config['smtp_password'];
|
121 |
$mail->Password = $config['smtp_password'];
|
122 |
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
122 |
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
- |
|
123 |
// if ignore_ssl is set to true, ignore SSL certificate verification
|
- |
|
124 |
if ($config['ignore_ssl']) {
|
- |
|
125 |
$mail->SMTPOptions = array(
|
- |
|
126 |
'ssl' => array(
|
- |
|
127 |
'verify_peer' => false,
|
- |
|
128 |
'verify_peer_name' => false,
|
- |
|
129 |
'allow_self_signed' => true
|
- |
|
130 |
)
|
- |
|
131 |
);
|
- |
|
132 |
}
|
123 |
$mail->Port = $config['smtp_port'];
|
133 |
$mail->Port = $config['smtp_port'];
|
124 |
|
134 |
|
125 |
// Set the sender's email address from the form
|
135 |
// Set the sender's email address from the form
|
126 |
if (!empty($_POST['requestor_email']) && !empty($_POST['requestor_name'])) {
|
136 |
if (!empty($_POST['requestor_email']) && !empty($_POST['requestor_name'])) {
|
127 |
$mail->setFrom($_POST['requestor_email'], $_POST['requestor_name']);
|
137 |
$mail->setFrom($_POST['requestor_email'], $_POST['requestor_name']);
|
Line 156... |
Line 166... |
156 |
for ($i = 0; $i < count($attachments['name']); $i++) {
|
166 |
for ($i = 0; $i < count($attachments['name']); $i++) {
|
157 |
if ($config['debug']) {
|
167 |
if ($config['debug']) {
|
158 |
echo "Processing Attachment.<br />";
|
168 |
echo "Processing Attachment.<br />";
|
159 |
echo $attachments['name'][$i];
|
169 |
echo $attachments['name'][$i];
|
160 |
}
|
170 |
}
|
- |
|
171 |
// Only send if the attachment uploaded OK
|
- |
|
172 |
if ($attachments['error'][$i] !== UPLOAD_ERR_OK) {
|
- |
|
173 |
continue;
|
- |
|
174 |
}
|
161 |
$mail->addAttachment($attachments['tmp_name'][$i], $attachments['name'][$i]);
|
175 |
$mail->addAttachment($attachments['tmp_name'][$i], $attachments['name'][$i]);
|
162 |
}
|
176 |
}
|
163 |
}
|
177 |
}
|
164 |
}
|
178 |
}
|
165 |
|
179 |
|
Line 285... |
Line 299... |
285 |
</label>
|
299 |
</label>
|
286 |
|
300 |
|
287 |
<?php if ($field['type'] == 'select'): ?>
|
301 |
<?php if ($field['type'] == 'select'): ?>
|
288 |
<select name="<?= htmlspecialchars($field['name']) ?>" id="<?= htmlspecialchars($field['name']) ?>" class="<?= $field['required'] ? 'required' : '' ?>">
|
302 |
<select name="<?= htmlspecialchars($field['name']) ?>" id="<?= htmlspecialchars($field['name']) ?>" class="<?= $field['required'] ? 'required' : '' ?>">
|
289 |
<?php foreach ($field['options'] as $value => $label): ?>
|
303 |
<?php foreach ($field['options'] as $value => $label): ?>
|
290 |
<option value="<?= htmlspecialchars($value) ?>"><?= htmlspecialchars($label) ?></option>
|
304 |
<option value="<?= htmlspecialchars($value) ?>" <?= isset($_POST[$field['name']]) && $_POST[$field['name']] == $value ? 'selected' : '' ?>><?= htmlspecialchars($label) ?></option>
|
291 |
<?php endforeach; ?>
|
305 |
<?php endforeach; ?>
|
- |
|
306 |
|
292 |
</select>
|
307 |
</select>
|
293 |
<?php elseif ($field['type'] == 'textarea'): ?>
|
308 |
<?php elseif ($field['type'] == 'textarea'): ?>
|
294 |
<textarea name="<?= htmlspecialchars($field['name']) ?>" id="<?= htmlspecialchars($field['name']) ?>" class="<?= $field['required'] ? 'required' : '' ?>"></textarea>
|
309 |
<textarea name="<?= htmlspecialchars($field['name']) ?>" id="<?= htmlspecialchars($field['name']) ?>" class="<?= $field['required'] ? 'required' : '' ?>"><?= isset($_POST[$field['name']]) ? htmlspecialchars($_POST[$field['name']]) : '' ?></textarea>
|
295 |
<?php else: ?>
|
310 |
<?php else: ?>
|
296 |
<input type="<?= htmlspecialchars($field['type']) ?>" name="<?= htmlspecialchars($field['name']) ?><?= $field['multiple'] ? '[]' : '' ?>" id="<?= htmlspecialchars($field['name']) ?>" class="<?= $field['required'] ? 'required' : '' ?>" <?= $field['multiple'] ? 'multiple' : '' ?>>
|
311 |
<input type="<?= htmlspecialchars($field['type']) ?>" name="<?= htmlspecialchars($field['name']) ?><?= $field['multiple'] ? '[]' : '' ?>" id="<?= htmlspecialchars($field['name']) ?>" class="<?= $field['required'] ? 'required' : '' ?>" <?= $field['multiple'] ? 'multiple' : '' ?>" value="<?= isset($_POST[$field['name']]) ? htmlspecialchars($_POST[$field['name']]) : '' ?>">
|
297 |
<?php endif; ?>
|
312 |
<?php endif; ?>
|
298 |
</div>
|
313 |
</div>
|
299 |
<?php endforeach; ?>
|
314 |
<?php endforeach; ?>
|
300 |
|
315 |
|
301 |
<input type="submit" value="Submit">
|
316 |
<input type="submit" value="Submit">
|