Exemplo n.º 1
0
<?php

// NOTE: See simpleproxy.php for usage
include_once '../lib/class_sendamail.php';
$m = new SendAMail();
echo $m->proxy();
Exemplo n.º 2
0
<html>
<head>
	<title>SendAMail - Simple example</title>
</head>

<body>
<?php 
if (isset($_POST['sendit'])) {
    include_once '../lib/class_sendamail.php';
    $m = new SendAMail();
    $m->from($_POST['from']);
    $m->to($_POST['to']);
    $m->subject($_POST['subject']);
    $m->text($_POST['text']);
    if ($m->send()) {
        echo "Your message has been send :)";
    } else {
        echo "<p>Error: {$m->error}";
    }
} else {
    ?>
		<form method="POST" action="simple.php">
			<input type="hidden" name="sendit" value="1" />
			
			<p>e-mail from: <input type="text" name="from" value="" />
			<p>e-mail to: <input type="text" name="to" value="" />
			<p>subject: <input type="text" name="subject" value="" />
			<p>text: <textarea name="text"></textarea>
			<p><input type="submit" value="send" />
		</form>
<?php 
Exemplo n.º 3
0
<?php

if (isset($_POST['sendit'])) {
    include_once '../lib/class_sendamail.php';
    $m = new SendAMail();
    $m->eol("\r\n");
    $m->from($_POST['from']);
    $m->to($_POST['to']);
    $m->subject('Blender is cool!');
    $m->html(file_get_contents('template/template.html'));
    if (!$m->embed('template/sintel-wallpaper-dragon.jpg')) {
        exit("<p>Error: {$m->error}");
    }
    if (!$m->embed('template/sintel-wallpaper-ishtar.jpg')) {
        exit("<p>Error: {$m->error}");
    }
    if (!$m->attach('template/doc.txt')) {
        exit("<p>Error: {$m->error}");
    }
    if ($r = $m->send()) {
        echo "<p>Okidokie :)";
    } else {
        echo "<p>Error: {$m->error}";
    }
} else {
    ?>
		<form method="POST" action="htmltemplate.php" enctype="multipart/form-data">
			<input type="hidden" name="sendit" value="1" />
			
			<p>e-mail from: <input type="text" name="from" value="" />
			<p>e-mail to: <input type="text" name="to" value="" />
Exemplo n.º 4
0
<?php

if (isset($_POST['sendit'])) {
    include_once '../lib/class_sendamail.php';
    $m = new SendAMail();
    $m->eol("\r\n");
    $m->from($_POST['from']);
    $m->to($_POST['to']);
    $m->subject($_POST['subject']);
    $m->text($_POST['text']);
    if ($ret = $m->sendProxy("http://a.host.net/mailproxy.php")) {
        echo "<p>Okidokie: {$ret}";
    } else {
        echo "<p>Error: {$ret}, {$m->error}";
    }
} else {
    ?>
		<form method="POST" action="simpleproxy.php" enctype="multipart/form-data">
			<input type="hidden" name="sendit" value="1" />
			
			<p>from: <input type="text" name="from" value="" />
			<p>to: <input type="text" name="to" value="" />
			<p>subject: <input type="text" name="subject" value="Proxy mail test" />
			<p>text: <textarea name="text"></textarea>
			<p><input type="submit" value="send mail" />
		</form>
<?php 
}
Exemplo n.º 5
0
<html>
<head>
	<title>SendAMail - Attachment example</title>
</head>

<body>
<?php 
if (isset($_POST['sendit'])) {
    include_once '../lib/class_sendamail.php';
    $m = new SendAMail();
    $m->from($_POST['from']);
    $m->to($_POST['to']);
    $m->subject($_POST['subject']);
    $m->text($_POST['text']);
    if (!$m->attach($_FILES['attach1'])) {
        exit("<p>Error: {$m->error}");
    }
    if (!$m->attach($_FILES['attach2'])) {
        exit("<p>Error: {$m->error}");
    }
    if ($m->send()) {
        echo "<p>Okidokie :)";
    } else {
        echo "<p>Error: {$m->error}";
    }
} else {
    ?>
		<form method="POST" action="attachment.php" enctype="multipart/form-data">
			<input type="hidden" name="sendit" value="1" />
			
			<p>email from: <input type="text" name="from" value="" />