Hello,
This is my first post here so cheers everyone... I am pretty new to PHP so please forgive me if I get some of the lingo wrong or dont make sense 🙂 🙂
Im working on a php code I found online. Im basically trying to send html emails (newsletters in a sense) to a group of signed up users. I have everything working but I want to be able to send images by PHP in the code below that creates the email and sends it out. Theres an html page that I fill out called mail_all.htm and it posts the info to mail_all.php (action="mail_all2.php")
So I need help sending/attaching an image with the code below.
THanks for the help!!!
HTML: B]
Insert in image into body area above:
<br><input type="file" name="e_pic" size="20">
php:
while ($sql = mysql_fetch_object($result))
{
$e_user = $sql -> u_name;
$e_addr = $sql -> u_email;
$send_it = $sql -> u_special;
if ($send_it == "special")
{
$subject = $_POST[e_subject];
$msg = "
<HTML>
<HEAD>
<TITLE>My Message</TITLE>
</HEAD>
<BODY text='#333333' style='font-family:Verdana, Arial, Helvetica, sans-serif ' >
<div align='center'>
<table width='700' border='1' cellpadding='0' cellspacing='0' bordercolor='#000000'>
<tr>
<td>
<table width='700' cellspacing='0' cellpadding='10' align='center' bordercolor='#333333' >
<tr bgcolor='#3399FF'>
<td width='540' valign='middle' bgcolor='#CCCCCC'><h2 align='left'>$_POST[e_header]</h2></td>
<td width='138' valign='middle' bgcolor='#CCCCCC'><font color='#333333' size='-2'>$_POST[e_date]</font></td>
</tr>
<tr bgcolor='#3399FF'>
<td colspan='2' bgcolor='#CCCCCC'>
<h4 align='left'>$_POST[e_headline]</h4>
</td>
</tr>
<tr >
<td colspan='2'>
</td>
</tr>
<tr>
<td colspan='2'><div align='left' style='padding: 10px '>$_POST[[B]e_pic[/B]]</div>$_POST[e_message] </td>
</tr>
<tr>
<td colspan='2'>
<hr size='2' noshade color='#F2F2F2'>
<font color='#999999' size='-2'>$_POST[e_footer]</font></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</BODY>
</HTML>
";
$headers = "From: No Reply <$adminemail>\nContent-Type: text/html; charset=iso-8859-1";
mail($e_addr, "$subject", "$msg","$headers");
echo "$e_user at email $e_addr<br> ";
}
}
?>
[code=php]