NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

<?php

use PHPMailerPHPMailerPHPMailer;
use PHPMailerPHPMailerSMTP;
use PHPMailerPHPMailerException;

require '../vendors/phpmailer/src/Exception.php';
require '../vendors/phpmailer/src/PHPMailer.php';
require '../vendors/phpmailer/src/SMTP.php';

if($_SERVER["REQUEST_METHOD"] == "POST") {
// Sender Data
$senderName = trim(strip_tags($_POST["name"]));
$senderEmail = filter_var(trim(strip_tags($_POST["email"])), FILTER_SANITIZE_EMAIL);
$senderSubject = trim(strip_tags($_POST["subject"]));
$senderMessage = trim(htmlentities($_POST["message"]));

if(empty($senderName) || empty($senderEmail) || empty($senderSubject) || empty($senderMessage)) {
// Set a 400 (bad request) response code and exit
http_response_code(400);
echo "Please complete the form and try again!";
exit;
} else {
if(!filter_var($senderEmail, FILTER_VALIDATE_EMAIL)) {
// Set a 400 (bad request) response code and exit
http_response_code(400);
echo "Invalid email format!";
exit;
}
}

$mail = new PHPMailer(true);

try {
//Server settings
$mail->isSMTP(); // Send using SMTP
$mail->Host = 'smtp1.example.com'; // Set the SMTP server to send through
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = 'secret'; // SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` also accepted
$mail->Port = 587; // TCP port to connect to

//Recipients
$mail->setFrom($senderEmail, $senderName);
$mail->addAddress('[email protected]', 'Your Name'); // Add a recipient
$mail->addReplyTo($senderEmail, $senderName);

// Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $senderSubject;
$mail->Body = "<b>Name</b>: $senderName<br><b>Email</b>: $senderEmail<br><br><b>Message</b>: $senderMessage";
$mail->AltBody = "Name: $senderNamenEmail: $senderEmailnnMessage: $senderMessage";

$mail->send();
echo 'Your message has been sent!';
} catch (Exception $e) {
http_response_code(400);
echo "Mailer Error: {$mail->ErrorInfo}";
}

} else {
// Not a POST request, set a 403 (forbidden) response code
http_response_code(403);
}

?>
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.