core php mail function without phpmailer
<?php
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
session_start();
$to = '[email protected]';
$subject = 'Subject xxxxx xxxxxx';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=charset=utf-8\r\n";
$headers .= "From: " . $_POST['email'] . "\r\n";
//$headers .= "Reply-To: ". $_POST['email'] . "\r\n";
$headers .= "CC: [email protected]\r\n";
$message = "<html><body>";
$message .= '<table style="border-color: #666; background: #eee; cellpadding="10">';
$message .= "<tr><td><strong>Name:</strong> </td><td>" . $_POST['username'] . "</td></tr>";
$message .= "<tr><td><strong>Email:</strong> </td><td>" . $_POST['email'] . "</td></tr>";
$message .= "</table>";
$message .= "</body></html>";
echo $message;
//echo $headers;
$response=mail($to, $subject, $message, $headers);
if($response==1)
{
echo "<script language='javascript' type='text/javascript'>
window.location = 'index.html';
</script>";
}
else{
echo
"<script language='javascript' type='text/javascript'>
alert('mail send failed');
</script>";
}
?>
Also in PHP:
- Title
- cpanel composer update kill
- Category
- PHP
- Title
- adding 2 in date() php
- Category
- PHP
- Title
- contains in string using php
- Category
- PHP
- Title
- add one day to given date in php
- Category
- PHP
- Title
- activerecord yii2 select with limit(start,end) not working
- Category
- PHP
- Title
- check if array key exists
- Category
- PHP
- Title
- date u php
- Category
- PHP
- Title
- check if string contains a word php
- Category
- PHP
- Title
- Who is known as the father of PHP?
- Category
- PHP
- Title
- array values php
- Category
- PHP
- Title
- array_count_values php
- Category
- PHP
- Title
- datetime mysql php
- Category
- PHP
- Title
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:
- Category
- PHP
- Title
- convert long timestamp to date in php
- Category
- PHP
- Title
- do_shortcode not working
- Category
- PHP
- Title
- delete register option laravel 7
- Category
- PHP
- Title
- codeigniter get last inserted data row
- Category
- PHP
- Title
- elevated th in dates format php
- Category
- PHP
- Title
- apt install php7.4-mbstring php7.4-zip php7.4-xml
- Category
- PHP
- Title
- create laravel project without template
- Category
- PHP
- Title
- detect long right click javascript
- Category
- PHP
- Title
- execute php in browser's console
- Category
- PHP
- Title
- create a function that checks the values of the indexes in two arrays and keep a score
- Category
- PHP
- Title
- encode and decode data in php
- Category
- PHP