I'm trying to send an e-mail using the PHP mail function and having two issues in regard to the below code:
1) When I get the e-mail - it is not formatted in HTML - instead I get just the actual HTML code in the e-mail - I get all e-mail via HTML by default so it doesn't appear to be a local setting.
2) I want to display in the e-mail the $img which is the image that someone has uploaded. However is my synatx correct on this line in order to concat the URL so it's formulated with the image held in $img:
$mailimg = '<img src="http://www.mysite.com/custom_images/images/".= $img"></a>';
<?php
$to ="mysite@z.net";
$from = $_POST['from'];
$msg = $_POST['msg'];
$img = $_REQUEST['show_image'];
//Image in e-mail
$mailimg = '<img src="http://www.mysite.com/custom_images/images/".= $img"></a>';
//Mail Body - Position, background, font color, font size...
$body ='
<html>
<head>
<style>
<!--
body, P.msoNormal, LI.msoNormal
{
background-position: top;
background-color: #336699;
margin-left: 10em;
margin-top: 1em;
font-family: "verdana";
font-size: 10pt;
font-weight:bold ;
color: "000000";
}
-->
</style>
</head>
</body>';
//To send HTML mail, the Content-type header must be set:
$headers='MIME-Version: 1.0n' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'To: System Admin <mysite@z.net>' . "\r\n";
$bodys .= "A image has just been uploaded for viewing<br>";
$bodys .= "$mailimg";
$subject .="Custom Image";
$body = $body . $bodys;
mail($to, $from, $subject, $body, $headers);
?>