diff --git a/index.html b/index.html new file mode 100644 index 0000000..c99737c --- /dev/null +++ b/index.html @@ -0,0 +1,71 @@ + + + + + PHP Mail Sender + + + + +
+ +
+
+
+

PHP Mailer over SMTP server

+

Server:

+ +

Username:

+ +

Password:

+ +

Port:

+ +

Encryption:

+ +

Email from:

+ +

Email to:

+ +
+
+ +
+
+ +
+
+
+
+

PHP mailer

+

Email from:

+ +

Email to:

+ +
+
+ +
+
+ +
+
+
+ + diff --git a/mail-smtp.php b/mail-smtp.php new file mode 100644 index 0000000..f018057 --- /dev/null +++ b/mail-smtp.php @@ -0,0 +1,41 @@ +isSMTP(); +$mail->Host = $_POST['server']; // Client's mail server +$mail->SMTPAuth = true; +$mail->Username = $_POST['username']; // Client's email username +$mail->Password = $_POST['password']; // Client's password +if ($_POST['encryption'] != "none") { + $mail->SMTPSecure = $_POST['encryption']; +} +$mail->Port = $_POST['port']; // SMTP Port + +// Mail configuration +$mail->setFrom($_POST['from-email'], 'Tester'); // Email From field + +// Recipient info +$mail->addAddress($_POST['recipient-email']); // Email To field +$mail->Subject = 'PHPMailer over SMTP Test'; // Email Subject field +$mail->Body = 'This email has been sent using PHPMailer (over SMTP) for test purposes.'; // Email Body field + +// Send email report +if(!$mail->send()) { + echo 'Message could not be sent.
'; + echo 'Mailer Error: ' . $mail->ErrorInfo; +} else { + echo 'Message has been sent.
'; + echo 'Server: ' . $_POST['server'] . '
'; + echo 'Port: ' . $_POST['port'] . '
'; + echo 'Encryption: ' . $_POST['encryption'] . '
'; + echo 'Username: ' . $_POST['username']; +} diff --git a/mail.php b/mail.php new file mode 100644 index 0000000..e661518 --- /dev/null +++ b/mail.php @@ -0,0 +1,26 @@ +setFrom($_POST['from-email'], 'Tester'); // Email From field + +// Recipient info +$mail->addAddress($_POST['recipient-email']); // Email To field +$mail->Subject = 'PHPMailer Test'; // Email Subject field +$mail->Body = 'This email has been sent using PHPMailer for test purposes.'; // Email Body field + +// Send email report +if(!$mail->send()){ + echo 'Message could not be sent.
'; + echo 'Mailer Error: ' . $mail->ErrorInfo; +}else{ + echo 'Message has been sent.'; +} diff --git a/php-mail-sender.zip b/php-mail-sender.zip new file mode 100644 index 0000000..3180513 Binary files /dev/null and b/php-mail-sender.zip differ