Skip to content

Instantly share code, notes, and snippets.

@Shakil-Shahadat
Last active December 18, 2021 01:42
Show Gist options
  • Save Shakil-Shahadat/67f8940804c3debc8761d9656155f882 to your computer and use it in GitHub Desktop.
Save Shakil-Shahadat/67f8940804c3debc8761d9656155f882 to your computer and use it in GitHub Desktop.
Send Email Using PHP
<?php
$to = 'test@example.com';
$subject = 'Test mail';
$message = 'Hello! This is a simple email message.';
$from = 'someone@example.com';
$headers = 'From: ' . $from;
mail( $to, $subject, $message, $headers );
echo 'Mail Sent.';
@Shakil-Shahadat
Copy link
Author

Shakil-Shahadat commented Dec 18, 2021

  • Move this to miscellaneous.php.
  • See if mail() returns anything, if so, improve this example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment