-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-html-with-attachment.php
34 lines (28 loc) · 1.34 KB
/
example-html-with-attachment.php
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
<?php
/** Require StagPHP SMTP Controller */
require 'dist/smtp.php';
if(isset($_POST['message'])){
if(!defined('SMC_FROM_NAME')) define('SMC_FROM_NAME', 'No Reply');
if(!defined('SMC_FROM_EMAIL')) define('SMC_FROM_EMAIL', '[email protected]');
if(!defined('SMC_REPLY_TO_NAME')) define('SMC_REPLY_TO_NAME', 'No Reply');
if(!defined('SMC_REPLY_TO_EMAIL')) define('SMC_REPLY_TO_EMAIL', '[email protected]');
$stag_smtp = new stag_smtp;
$test = 'Test Email From Development Form';
$result = $stag_smtp->send_mail(array(
'to' => '[email protected]',
'subject' => $test,
'html-email' => TRUE,
'template-loc' => dirname(__FILE__).'/template.html',
'template-data' => array(
'title' => $test,
'heading' => $test,
'content' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.'
),
'attachment-field-name' => 'attachment'
));
} ?>
<form enctype="multipart/form-data" method="POST" action="">
<label>Message <textarea name="message"></textarea></label>
<label>Attachment <input type="file" name="attachment" /></label>
<label><input type="submit" name="button" value="Submit" /></label>
</form>