I've not seen you full code, but below is a working sample that you can use or customize to your needs.
PHP Code:
<html>
<head>
<title></title>
<style type="text/css">
<!--
.row1{
font-family: Verdana, Geneva, Arial, helvetica, sans-serif;
font-size:11px;
font-type:normal;
padding:2px;
background-color:#E6E6E6;}
.row2{
font-family: Verdana, Geneva, Arial, helvetica, sans-serif;
font-size:11px;
font-type:normal;
padding:2px;
background-color: #F2F2F2;}
-->
</style>
</head>
<body>
<?php
//check that variables filled
if(isset($_POST['submit']))
{
//request type
$test = trim($_POST['test']);
$test2 = trim($_POST['test2']);
$test3 = trim($_POST['test3']);
$recipient2=$email;
$toaddress = 'email_1@123.com,email_2@123.com';
$subject = 'subject: ';
$mailcontent = 'test: '.$test."\n"
.'test2: '.$test2."\n"
.'Wtest3: '.$test3."\n";
$fromaddress = "From: 123@123.com,\r\n";
$fromaddress .="BCC: 123@123.com,1235@123.com\r\n";
//prototype is mail(string to, string subject, string message, string additional_headers, string additional_parameters)
mail($toaddress, $subject, $mailcontent, $fromaddress);
if(!mail)
{
echo'<table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr align="center">
<td colspan="1" align="left">
<img src="mpsgi.gif" border="0"></td>
<tr />
<td>
<font size="6">Email Form</font>
</td>
<tr />
<td> </td>
<tr />
<td>There was a problem sending your email: </td>
</table>';
exit;
}
else
{
echo'<table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr align="center">
<td colspan="1" align="left">
<img src="mpsgi.gif" border="0"></td>
<tr />
<td>
<font size="6">Change Control Form</font>
</td>
<tr />
<td> </td>
<tr />
<td>Thank you for email.</td><tr><td><b>Date: </b>';
echo'</td>';
echo'</tr>
</table>';
exit;
}
}
?>
</body>
</html>
Bookmarks