Quantcast
Viewing all articles
Browse latest Browse all 5

Simple mail function in PHP

Here is a quick PHP email function. Just change the variables to your information and use it.

<?php

$toName = “To Name”;
$toEmail = “toemail@domain.com”;
$fromEmail = fromemail@domain.com;

$subject = “Email Message Subject Text”;

$msg = “Email message text <b>Can be HTML formatted</b>”;

$headers = “From: \”Your Real Name\” <” . $fromEmail . “>\r\n”.
“To: \” . $toName . “\” <” . $toEmail . “>\r\n”.
“Date: “.date(“r”).”\r\n”.
“Subject: ” . $subject . “\r\n”.
“Content-type: text/html; charset=us-ascii”;

mail($toEmail, $subject, $msg, $headers);

 ?>


Viewing all articles
Browse latest Browse all 5

Trending Articles