mail php
This commit is contained in:
36
php/php-dog/tstEmail.php
Normal file
36
php/php-dog/tstEmail.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Access-Control-Allow-Headers: access");
|
||||
header("Access-Control-Allow-Methods: POST");
|
||||
header("Content-Type: application/json; charset=UTF-8");
|
||||
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
|
||||
|
||||
session_start();
|
||||
|
||||
require __DIR__.'/classes/Database.php';
|
||||
require __DIR__.'/classes/lib.php';
|
||||
|
||||
|
||||
$to_email = 'p.para@gmx.de';
|
||||
$subject = 'Testing PHP Mail';
|
||||
$message = 'Bcc This mail is sent using the PHP mail function';
|
||||
$headers[] = 'From: p.hoppe@gmx.de';
|
||||
$headers[] = 'Cc: p.hoppe@gmx.de';
|
||||
$headers[] = 'Bcc: dog@hope-fly.de';
|
||||
try
|
||||
{
|
||||
$ret = mail($to_email,$subject,$message,implode("\r\n", $headers));
|
||||
if($ret)
|
||||
{
|
||||
echo 'mail ok\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'mail error\n';
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
echo 'Caught exception: ', $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user