Answers for "send emails php"

28

php mail

<?php
$to = $_POST['email'];
$subject = "Email Subject";

$message = 'Dear '.$_POST['name'].',<br>';
$message .= "We welcome you to be part of family<br><br>";
$message .= "Regards,<br>";

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers
$headers .= 'From: <[email protected]>' . "\r\n";
$headers .= 'Cc: [email protected]' . "\r\n";

mail($to,$subject,$message,$headers);
?>
Posted by: Guest on May-28-2020
0

php mail

mnjah
Posted by: Guest on August-07-2021
0

php mail

$mailtext = '<html>
<head>
    <title>HTML-E-Mail mit PHP erstellen</title>
</head>

<body>
...
</body>
</html>
';

$empfaenger = "[email protected]";  // Mailadresse
$absender   = "[email protected]";
$betreff    = "Mail-Test - HTML-E-Mail mit PHP erstellen";
$antwortan  = "[email protected]";

$header  = "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html; charset=utf-8\r\n";

$header .= "From: $absender\r\n";
$header .= "Reply-To: $antwortan\r\n";
// $header .= "Cc: $cc\r\n";  // falls an CC gesendet werden soll
$header .= "X-Mailer: PHP ". phpversion();

mail( $empfaenger,
      $betreff,
      $mailtext,
      $header);

echo "Mail wurde gesendet!";
Posted by: Guest on October-24-2020
0

send email in php

<?php
    ini_set( 'display_errors', 1 );
    error_reporting( E_ALL );
    $from = "[email protected]";
    $to = "[email protected]";
    $subject = "Checking PHP mail";
    $message = "PHP mail works just fine";
    $headers = "From:" . $from;
    if(mail($to,$subject,$message, $headers)) {
		echo "The email message was sent.";
    } else {
    	echo "The email message was not sent.";
    }
    ?>
Posted by: Guest on April-29-2021
1

php mail example

$message = '
<html>
<head>
  <title>Review Request Reminder</title>
</head>
<body>
  <p>Here are the cases requiring your review in December:</p>
  <table>
    <tr>
      <th>Case title</th><th>Category</th><th>Status</th><th>Due date</th>
    </tr>
    <tr>
      <td>Case 1</td><td>Development</td><td>pending</td><td>Dec-20</td>
    </tr>
    <tr>
      <td>Case 1</td><td>DevOps</td><td>pending</td><td>Dec-21</td>
    </tr>
  </table>
</body>
</html>
';
Posted by: Guest on October-22-2020

Browse Popular Code Answers by Language